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
When I give the program a specific file it crashes with the error
TypeError: traverse is not a function
at replaceImportWithDummy (node_modules/treeche-core/lib/replaceImportWithDummy/mod.js:9:5)
Looking into it, the problem is that @babel/traverse and @babel/generator are both CommonJS modules that export an object with __esModule: true and a default key, which Node's native ESM importer treats as a single export default {default: <value> }, rather than splitting it into default and named imports. The fix is pretty simple, you need to either transpile into CJS with esModuleInterop: true, or you need to manually unwrap the default key when using those imports.
The text was updated successfully, but these errors were encountered:
When I give the program a specific file it crashes with the error
Looking into it, the problem is that
@babel/traverse
and@babel/generator
are both CommonJS modules that export an object with__esModule: true
and adefault
key, which Node's native ESM importer treats as a singleexport default {default: <value> }
, rather than splitting it into default and named imports. The fix is pretty simple, you need to either transpile into CJS withesModuleInterop: true
, or you need to manually unwrap thedefault
key when using those imports.The text was updated successfully, but these errors were encountered: