-
Notifications
You must be signed in to change notification settings - Fork 1
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
ESM compatibility #4
Comments
@talentlessguy Tbh. those requires cannot be moved to the top of sosse. They have to be called dynamically after file changes - thats the essential part for the hot server reload ;). Maybe there is a chance to switch to dynamic imports, but this is not something I can quickly change, I have to test this in the very detail of each require ^^. |
@katywings oh ok, no worries. I could maybe try to find the way to load CJS version of Sosse 🤔 |
@talentlessguy I investigated this and in the end got stuck in an upstream blocker 🤦 Hot module replace currently is only possible with This is the corresponding upstream issue: nodejs/node#49442 I gonna watch that upstream issue but ESM support has to unfortunately wait for now 🙈 |
Also something that should be watched going forward nodejs/node#49452. |
require
is not defined in the ESM version of Sosse
Hello, while making a simple dev server I noticed that Sosse still uses
require
, even in the ESM generated codeNode disallows using
require
in the ESM module. So it should be imported in the top so it properly builds toimport chokidar from 'chokidar'
The full stacktrace is this:
Sosse version: 0.6.0
Node version: 14.5.0
The text was updated successfully, but these errors were encountered: