-
Notifications
You must be signed in to change notification settings - Fork 24
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 import error #16
Comments
Can you try running |
Closing as there is no answer and I cannot replicate this. |
You didn't give me a lot of time there :) Anyhow, that does indeed work. As does renaming |
I'm running into this same issue, but I'm not sure what the fix is. What's |
@NickHeiner Just do |
I'm using turbowatch programmatically. My goal is to detect when files in a directory change, then take action via the event emitter. |
@NickHeiner In that case, you will need to either adopt esm or use something like |
Hey @gajus, do you mind taking a look at this bare minimum repo where the error can be reproduced? There is only a single
Not exactly sure what is causing this, a week or so ago everything was working, but unfortunately I am still early in development and wasn't keeping history. As you can see I'm using Node 20 with package.json of Cheers! |
I'm seeing the same issue as @virtuallyunknown just by copying the example from the docs. Same issue with node 18 as well. Is there any example somewhere of it working? |
It is not an issue if you are using |
I was previously using This might sound like a very silly thing to complain about, but when you're developing and restarting your monorepo all day long it becomes annoying. |
I am also facing same issue like above. Build triggering for following services
|
That's a graceful termination feature. The first time you send a signal with ctrl+c it initiates graceful termination and waits for all services to shutdown. If you don't wait and press again, then you force terminate all scripts. |
Any way to disable this? I am only using turbowatch in development, data loss and whatever else graceful termination prevents is not a risk for me. |
I cannot imagine a scenario where this is desirable. You will be leaving hanging services left and right. If you want your services to shutdown immediately, then add the logic to the application itself to shutdown immediately (when in |
You said that the first signal is graceful termination, and the second signal is forceful termination. So I was asking if there is a way I can instead configure the first signal to be the forceful termination. |
I had the same const zx_1 = require("zx");
^
Error [ERR_REQUIRE_ESM]: require() of ES Module error earlier too, I made a package to host my The package for reference (It's very far from a lightweight reproduction, I didn't mean it as such):
|
You could, but depending on what services you are running, there is no guarantee that it will shutdown all the services. I would not do it as a default as it is bound to cause more confusion than anything. |
I am absolutely not asking you to make this the default behavior of turbowatch, that would be quite irresponsible of me since I don't know what complications would arise from that. I was merely asking if you could tell me how I can configure this for my own project. |
Can Some please help me on this.Thanks in advance. |
Just hit this as well when trying to use turbowatch as a library in an ESM project.
|
Running one of the below
produces
Expected Behavior
It should work to import the library
Possible Solution
Publish turbowatch as ESM. Possibly you could consider hybrid, but it seems
zx
is ESM only (due to node-fetch?), as well as serialize-errorOr am I missing something?
The text was updated successfully, but these errors were encountered: