`npm run dev` does not work due to esm
What happened?
After a clean install, running npm dev results in the following message in the browser:
Lambda init error
Error: SyntaxError: Cannot use import statement outside a module
Lambda: @http any /*
Source: /Users/workplace/trance-stack/server
: Cannot use import statement outside a module
Stack trace:
/Users/workplace/trance-stack/server/index.js:291,import { createRequestHandler } from "@remix-run/architect";,^^^^^^,,SyntaxError: Cannot use import statement outside a module, at internalCompileFunction (node:internal/vm:77:18), at wrapSafe (node:internal/modules/cjs/loader:1288:20), at Module._compile (node:internal/modules/cjs/loader:1340:27), at Module._extensions..js (node:internal/modules/cjs/loader:1435:10), at Module.load (node:internal/modules/cjs/loader:1207:32), at Module._load (node:internal/modules/cjs/loader:1023:12), at Module.require (node:internal/modules/cjs/loader:1235:19), at require (node:internal/modules/helpers:176:18), at run ([eval]:1:2236), at main ([eval]:1:6973)
FWIW It does deploy and run correctly in AWS after a cdk deployment.
What did you expect to happen?
I expected it to run.
What version of Remix are you using?
2.5.0
Can confirm this on a clean install on MacOS Sonoma 14.3.1 with an M1 (not that any of that really matters for the ESM error). This seems worth fixing ASAP due to it being a major hurdle to anyone trying to adopt Trance for the first time.
Can confirm this on a clean install on MacOS Sonoma 14.3.1 with an M1 (not that any of that really matters for the ESM error). This seems worth fixing ASAP due to it being a major hurdle to anyone trying to adopt Trance for the first time.
FWIW I also hit this on an intel MBP.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Commenting to prevent the issue from closing
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.