You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some packages (as uniqid) make checks like if(typeof require !== 'undefined') to ensure that we are in node env.
But vite replace that require to _require which is defined and then "module as been externalized"...
I think if it is not function call, there is no need to transform that check.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Hello @zorn-v. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.
Describe the bug
Some packages (as
uniqid
) make checks likeif(typeof require !== 'undefined')
to ensure that we are in node env.But vite replace that
require
to_require
which is defined and then "module as been externalized"...I think if it is not function call, there is no need to transform that check.
Reproduction
https://stackblitz.com/edit/vitejs-vite-dpwfwp?file=main.js
adamhalasz/uniqid#48
Steps to reproduce
Then open http://localhost:5173/ in browser and check browser console
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: