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
in the original code the require() returns a function, in the transformed code however, the getDefaultExportFromNamespaceIfNotNamed()is returning the module with that function under a "default" property, leading to this error. I suspect this is because that module has more than one property and Object.keys(n).length === 1 condition returns false.
This error does occur only when using a development server.
Steps to reproduce
npx create-snowpack-app
install define-properties (npm i define-properties)
import that package and use it
start the dev server
open the page in the browser
it will fail with a Uncaught TypeError: require$$0 is not a function error in the console
Link to minimal reproducible example (optional)
No response
The text was updated successfully, but these errors were encountered:
Quick checklist
What package manager are you using?
yarn
What operating system are you using?
Linux
Describe the bug
Dev server fails with an
Uncaught TypeError: require$$0 is not a function
. This error occurs in a transformed file of a define-properties package.It appears to me that this bug occurs due to incorrect transformation of that package
require()
call. In the package the following line:is being transformed to
in the original code the
require()
returns a function, in the transformed code however, thegetDefaultExportFromNamespaceIfNotNamed()
is returning the module with that function under a "default" property, leading to this error. I suspect this is because that module has more than one property andObject.keys(n).length === 1
condition returns false.This error does occur only when using a development server.
Steps to reproduce
npx create-snowpack-app
npm i define-properties
)Uncaught TypeError: require$$0 is not a function
error in the consoleLink to minimal reproducible example (optional)
No response
The text was updated successfully, but these errors were encountered: