trance-stack icon indicating copy to clipboard operation
trance-stack copied to clipboard

`npm run dev` does not work due to esm

Open cheruvian opened this issue 2 years ago • 5 comments

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

cheruvian avatar Jan 17 '24 05:01 cheruvian

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.

trogers1 avatar Feb 17 '24 23:02 trogers1

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.

cheruvian avatar Mar 03 '24 00:03 cheruvian

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.

stale[bot] avatar Jun 01 '24 11:06 stale[bot]

Commenting to prevent the issue from closing

israpasos avatar Jul 14 '24 18:07 israpasos

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.

stale[bot] avatar Oct 17 '24 02:10 stale[bot]