-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Error [ERR_REQUIRE_ESM]: require() of ES Module
#3
Comments
Hi @cliffordfajardo , I really appreciate the detailed bug reports! Thanks so much. For this one, CommonJS server modules are not currently supported, please convert it to an ES Module by renaming to server.mjs and with code similar to the below. I'll update the getting started guide.
|
Hi @cliffordfajardo, thanks again for the report! This should be fixed in v0.2.1 where I've made the dev server entry file commonjs. There's only a minor change required now for the express template which is to add a require(BUILD_DIR); to the server.js. which avoids the first request failing. app.listen(port, () => {
require(BUILD_DIR);
console.log(`Express server listening on port ${port}`);
}); This ensures the RemixKit dev client is initialized by the time the first request comes in since we can't do top level await in commonjs. |
Hi I'm encountering the following error:
Not really sure what's going on. Using 0.2.3 |
hey @pigoz |
Unfortunately it's on a proprietary app. I'll try to come up with a repro. |
Describe the bug
After upgrading from remix-kit
0.1.0
to0.1.2
in #2 , the next thing I did was runnpm run dev
When attempting to setup
remix-kit
on a new remix express template following the getting started guide, I get the following message when runningnpm run dev
.What to Expect as a User
As a user wanting to use remix-kit, I expect few changes to be able to get my existing remix project running
For example, changing
scripts
in package json and the server.js file (entry point)Reproduction
https://github.com/cliffordfajardo/remix_kit_repro1
Steps to reproduce
1.Start a new remix express project
See my github repo and try to run it, I've upgraded to remix-kit
0.1.2
System Info
Used Package Manager
npm
Validations
Screenshots
The text was updated successfully, but these errors were encountered: