-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Failed to create esm bundled application #7467
Comments
If the assumption above is correct (ESM exports missing) I will try to create a PR which addresses the issue. |
The 'serverDependenciesToBundle' attribute should not match all. |
Was anyone able to figure this out? I'm facing the same issue. |
Not yet |
Also ran into this on Remix 2.0.1 when building to deploy to AWS Lambda, using either @remix-run/architect or remix-aws. This error occurred when using remix-aws:
or this one when using @remix-run/architect:
Workaround was to bundle the server module as CommonJS by removing
which is not ideal, but works for us for now. |
...that is, I thought it worked for us, but instead it results in the issue described here: #7761 |
Having `type: "module"` in `package.json` along with `serverDependenciesToBundle: "all"` in `remix.config.js` causes a build error: Error: Dynamic require of "http" is not supported Oddly, in this integration test, it appears to happen at run time (unless I'm misreading the stack trace), whereas in the description of remix-run#7467, the error appears at build time.
This PR repros the bug with a failing integration test: #7779 What else needs to happen for a
bug:unverified
to become a
bug
|
I tried working on it for a few more hours, I was able to hack remix.run to run in CJS mode but it has issues. Will keep trying. I found this site: |
The solution to this is as @mao437303994 mentioned, do not use |
What version of Remix are you using?
2.0.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
pnpx create-remix@latest test
.remix.config.js
addserverDependenciesToBundle: [/.*/]
pnpm run dev
.Expected Behavior
The application should start.
Actual Behavior
The application actually fails while trying to
require
'http' from node.It looks like the package
@remix-run/node
does not contain any valid esm export. I assume it does fallback to commonjs instead and from there it takes@remix-run/web-fetch
in commonjs as well.Not sure if this is the correct assumption.
The text was updated successfully, but these errors were encountered: