Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't import the named export 'parse' from non EcmaScript module (only default export is available) #73

Closed
joebailey26 opened this issue Aug 22, 2021 · 1 comment

Comments

@joebailey26
Copy link

Version 0.7.0 and 0.7.1

wrangler dev and wrangler publish

Result in:

./node_modules/worktop/router/index.mjs 80:36-37
Can't import the named export 'parse' from non EcmaScript module (only default export is available)
    at HarmonyImportSpecifierDependency._getErrors (C:\Users\billy\AppData\Local\.wrangler\wranglerjs-1.19.0\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:88:6)
    at HarmonyImportSpecifierDependency.getErrors (C:\Users\billy\AppData\Local\.wrangler\wranglerjs-1.19.0\node_modules\webpack\lib\dependencies\HarmonyImportSpecifierDependency.js:68:16)
    at Compilation.reportDependencyErrorsAndWarnings (C:\Users\billy\AppData\Local\.wrangler\wranglerjs-1.19.0\node_modules\webpack\lib\Compilation.js:1463:22)
    at C:\Users\billy\AppData\Local\.wrangler\wranglerjs-1.19.0\node_modules\webpack\lib\Compilation.js:1258:10
    at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\billy\AppData\Local\.wrangler\wranglerjs-1.19.0\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:24:1)
    at AsyncSeriesHook.lazyCompileHook (C:\Users\billy\AppData\Local\.wrangler\wranglerjs-1.19.0\node_modules\tapable\lib\Hook.js:154:20)
    at Compilation.finish (C:\Users\billy\AppData\Local\.wrangler\wranglerjs-1.19.0\node_modules\webpack\lib\Compilation.js:1253:28)
    at C:\Users\billy\AppData\Local\.wrangler\wranglerjs-1.19.0\node_modules\webpack\lib\Compiler.js:672:17
    at eval (eval at create (C:\Users\billy\AppData\Local\.wrangler\wranglerjs-1.19.0\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:11:1)
    at C:\Users\billy\AppData\Local\.wrangler\wranglerjs-1.19.0\node_modules\webpack\lib\Compilation.js:1185:12
    at C:\Users\billy\AppData\Local\.wrangler\wranglerjs-1.19.0\node_modules\webpack\lib\Compilation.js:1097:9
    at processTicksAndRejections (internal/process/task_queues.js:75:11)
 @ ./index.js
Error: webpack returned an error. You may be able to resolve this issue by running npm install.
@lukeed
Copy link
Owner

lukeed commented Aug 22, 2021

Hey,

Duplicate of #62

TLDR: webpack is intentionally annoying and employs its own variant of module loading, which is non spec-compliant and at this point, years in, they're just being stubborn about it. Their lack of proper .mjs support is widely known and there are a number of workarounds. A few options are found in the linked issue.

Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants