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

v0.7.0 and greater fail to start #81

Closed
rts-rob opened this issue Sep 13, 2021 · 1 comment
Closed

v0.7.0 and greater fail to start #81

rts-rob opened this issue Sep 13, 2021 · 1 comment

Comments

@rts-rob
Copy link

rts-rob commented Sep 13, 2021

Projects created with wrangler and worktop v0.7.0 and greater fail to run on macOS (Apple M1 and Intel). Details and steps to reproduce follow.

The problem appears to be related to:

Steps to recreate

In an empty directory:

  1. npm init --yes
  2. wrangler init
  3. Paste the worktop basic example code into a new file index.js
  4. npm install worktop@0.6.3
  5. wrangler dev

At this point the Cloudflare Workers development environment starts up and serves your API at 127.0.0.1:8787. Everything works as expected.

In the same directory:

  1. npm install worktop@0.7.0 (or 0.7.1-0.7.3)
  2. wrangler dev

Wrangler fails with the following:

➜  ~ wrangler dev
👀  ./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 (/Users/rob/Library/Caches/.wrangler/wranglerjs-1.19.0/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:88:6)
    at HarmonyImportSpecifierDependency.getErrors (/Users/rob/Library/Caches/.wrangler/wranglerjs-1.19.0/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:68:16)
    at Compilation.reportDependencyErrorsAndWarnings (/Users/rob/Library/Caches/.wrangler/wranglerjs-1.19.0/node_modules/webpack/lib/Compilation.js:1463:22)
    at /Users/rob/Library/Caches/.wrangler/wranglerjs-1.19.0/node_modules/webpack/lib/Compilation.js:1258:10
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/rob/Library/Caches/.wrangler/wranglerjs-1.19.0/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:24:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/rob/Library/Caches/.wrangler/wranglerjs-1.19.0/node_modules/tapable/lib/Hook.js:154:20)
    at Compilation.finish (/Users/rob/Library/Caches/.wrangler/wranglerjs-1.19.0/node_modules/webpack/lib/Compilation.js:1253:28)
    at /Users/rob/Library/Caches/.wrangler/wranglerjs-1.19.0/node_modules/webpack/lib/Compiler.js:672:17
    at eval (eval at create (/Users/rob/Library/Caches/.wrangler/wranglerjs-1.19.0/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:11:1)
    at /Users/rob/Library/Caches/.wrangler/wranglerjs-1.19.0/node_modules/webpack/lib/Compilation.js:1185:12
    at /Users/rob/Library/Caches/.wrangler/wranglerjs-1.19.0/node_modules/webpack/lib/Compilation.js:1097:9
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
 @ ./index.js
Error: webpack returned an error. You may be able to resolve this issue by running npm install.

Versions where issue observed:

  • OS: macOS Big Sur v11.5.2
  • Chip: Apple M1
  • Node.js: v14.17.6 (latest LTS at time of filing issue), v15.14.0
  • Wrangler: v1.19.0, v1.19.2
  • Worktop: v0.7.0, v0.7.1, v0.7.2, v0.7.3

Second machine (I don't have access to get complete version info):

  • OS: macOS
  • Chip: Intel
  • Node.js: v16.4.0
@lukeed
Copy link
Owner

lukeed commented Sep 13, 2021

The problem is webpack. It ships non-standard "exports" and ESM resolvers and they won't fix it. It works in/with all other bundlers. See #62 and #73 for solution(s)

Sorry for the trouble, but everything is defined correctly. Closing as duplicate.

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