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

npm run dev does not work due to esm #681

Open
cheruvian opened this issue Jan 17, 2024 · 5 comments
Open

npm run dev does not work due to esm #681

cheruvian opened this issue Jan 17, 2024 · 5 comments
Labels
bug Something isn't working stale

Comments

@cheruvian
Copy link

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 cheruvian added the bug Something isn't working label Jan 17, 2024
@trogers1
Copy link

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.

@cheruvian
Copy link
Author

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.

Copy link

stale bot commented Jun 1, 2024

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 stale bot added the stale label Jun 1, 2024
@israpasos
Copy link

Commenting to prevent the issue from closing

@stale stale bot removed the stale label Jul 14, 2024
Copy link

stale bot commented Oct 17, 2024

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 stale bot added the stale label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants