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
rollup -c not quit after created bundle #4213
Comments
I faced the same issue: rollup 2.56.3 on macOS 11.5.2, NodeJS 14.17.5 |
I have same issue in wsl2 - window 10 |
Same issue on Ubuntu 21.04 with node 15.11.0 |
Same here on Windows 10 |
Same issue here. I noticed it seemed to be (at least in my case) related to the version of TypeScript. When I upgraded to 4.4.2 (latest as of right now). I downgraded to TypeScript 4.3.5 and it seemed to resolve my problem. Occurring on Windows 10, WSL (Debian) and Linux (RHEL 8.4) - all using Node 14.17.5 |
It seems the problem is with This Line 23 in 81fa9e9
Gets transpiled into ...
else {
try {
require('source-map-support').install();
}
catch (err) {
// do nothing
}
runRollup(command);
} The If this error happens on your local machine, you can try editing runRollup(command).then(() => process.exit()); Try. It's more difficult to do on a CI of course but still possible. My research so far
|
Actually, I met this problem because of upgrading TypeScript by dependabot. I noticed it has some break changes. |
Downgrading TypeScript from 4.4.2 to 4.3.5 fixes the issue for me. |
use rollup-plugin-typescript2 instead of rollup-plugin-typescript2 |
Also see rollup/plugins#983 |
Tem uma issue no typescript porque está travando o build. microsoft/TypeScript#45642 rollup/rollup#4213
- tsc bug (peer dep req'd by rollup-plugin-dts) causes rollup builds to hang indefinitely; see: rollup/rollup#4213
* Novo componente * feat: correção da versão do typescript Tem uma issue no typescript porque está travando o build. microsoft/TypeScript#45642 rollup/rollup#4213
Fixed with TypeScript 4.4.3 |
I'm facing this problem. Typescript 4.6.3. @revelt is correct that this method needs to be awaited or completed with a then callback. How does Typescript affect this? |
@mattxyzeth if I may advise,
At least back then, when we were facing the problem, correct, that's what worked — but I rolled back my dependency bumps and waited it out until 4.4.3 (and eventually migrated to esbuild).
If you mean the bug, it could have been anything. Typescript is a whole ecosystem — AST's, mapping of what-in-TS gets transpiled to what-in-JS and so on. For example, zalgo could have been released in the transpiled output. I don't know. Personally, since, I migrated from |
I'm not entirely convinced it's related to TS. My app has two builds—one for the app and one for the service workers. The build always hangs in my local environment for the app and never for the workers. On my CI server, it only hangs once in a while for the app and never for the workers. As for your suggestions, I've ruled out the first two. The most stable combination is if I downgrade TS to 4.4.3, but it fails intermittently. Everything always works with any version if I apply the patch in number 3. I'm wondering why this isn't used as the default. Is there a downside to adding this? EDIT: I upgraded all my rollup plugins that were not in common between my service worker's config and my app config. I also upgraded TS to the latest version. The build started exiting properly in my local environment. So I tried to mimic the exact same environment on my CI server except for the OS but it's still failing there. Then after a few tries in my local environment, it started to hang again, without any changes. |
We've tracked down our issue to an unrelated animation package imported into our bundle. So it seems that this issue extends beyond the plugins. We don't have a clear idea of why this package was causing the build to not exit. The build completes successfully but doesn't exit 100% of the runs. We saw an average of a 30% success rate across multiple computers and environments. Unfortunately, I don't think that the patch mentioned in this thread is the ultimate solution since the problem could indicate a much larger issue in the bundle and not directly related to the build process. Maybe there should be some timeout error that means something was left hanging that has caused the build not to exit correctly. |
We ran into this when leveraging rollup in a RushJS monorepo. Multiple builds happening at the same time. When building the monorepo we would get rollup not exiting after building a package, on various packages (nothing deterministic). This was very common and very reproducible. I tested the proposed solution from #4213 (comment) and this has seemingly solved the problem. Likely exasperated by multiple processes/concurrency? I've got a local PNPM patch to test it more long term at the moment. |
Wow we have exactly the same issue with RushJs, can you share more details
about your fix/patch please? Thanks a lot!
|
I use pnpm and so used https://pnpm.io/cli/patch in order to persist the change suggested by the comment I linked to in my previous reply. It's not a long term fix. Perhaps roll-up will accept a contribution. |
Sorry for completely missing this issue. While I cannot reproduce it, adding the proposed force exit should not pose any problems, I will put it into the next release. |
Please check out #4969 |
This issue has been resolved via #4969 as part of rollup@3.21.3. You can test it via |
Can we reopen this @lukastaegert? It looks like the fix has been reverted. |
@lukastaegert I've had success using the same workaround from the revert pr. For anyone struggling with this, but needing to intake new rollup versions, try adding this as the last plugin in your plugin array in
|
@chordmemory thanks, I've been banging my head against this for the last couple days and your suggestion works well in my project |
@chordmemory this works wonders, maybe rollup should have that inside the codebase just in case a plugin keeps handles open after outputting |
That is what I tried, but it breaks a lot of stuff for other workflows. The only good solution would be to figure out what exactly is keeping the process open, but we had no success so far as it does not happen very reliably. |
@lukastaegert I have a pretty complicated config that can reliably reproduce (1/2 times) - I can't share it, but do you have any advice or ideas for how to debug the leak? |
Not really. To my knowledge, there are mostly two things that can prevent a process from completing:
Maybe using the Chrome debugger attached to the Node process might give a clue what might still be running or scheduled. I had no luck reproducing the issue in a situation where I had a debugger attached so far. |
Have you tried https://github.com/mafintosh/why-is-node-running ? |
Thanks! I've implemented a solution based on your suggestion, and I feel rather confident this will work. Had to slightly modify it though, as my rollup config exports an array of configurations; and I want them all to complete. For anybody in a similar situation; here's my solution:
This also tries to account for any other plugins that might want to do some amount of work in closeBundle |
This issue has been resolved via #5195 as part of rollup@4.3.0. You can test it via |
* fix: Use npx, not yarn * fix: Update common, server * fix: Update comment * chore: Update dependencies * fix: Modify tests for poll * fix: Use styled components * fix: Update extention * fix: update settings * chore: Add package-lock.json * fix: Use npx instead of yarn * fix: Use npm to execute script * fix: call eslint and jest through npm script * fix: Use npm scripts * fix: Use node 18.16.0 nodejs/node#51048 * fix: Fix type check * fix: Update rollup-typescript plugin * fix: Update rollup rollup/rollup#4213 * fix: Update entry point * fix: Add workaround for hung up on windows-latest * fix: Add windows hungup workaround
## What is the purpose of this PR? Sometimes when running the pluggable widget tools script for release or build a widget, the rollup doesn’t finish the process. That happens in the editorConfig step. ## Relevant changes To resolve that for now I have followed one suggestion from the rollup repository PR to force close the process because we’re still using rollup v3 in the pluggable widget tools. That was fixed in v4, it was created one new parameter to pass to rollup to force exit. If so, then this fix can be removed and starts to use the new parameter mentioned above. rollup/rollup#4213 (comment)
Rollup Version
2.56.3
Operating System (or Browser)
windows-latest, ubuntu-latest, macos-latest in github actions
Node Version (if applicable)
16.8.0
Link To Reproduction
https://github.com/sunshineplan/sda/actions/runs/1174174007
Expected Behaviour
rollup quit after created bundle, so other github actions will go on.
Actual Behaviour
rollup hang up after created bundle
The text was updated successfully, but these errors were encountered: