Skip to content
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

Certain inputs trigger infinite loop in findFirstLineBreakOutsideComment #4672

Closed
Silic0nS0ldier opened this issue Oct 14, 2022 · 4 comments · Fixed by #4676
Closed

Certain inputs trigger infinite loop in findFirstLineBreakOutsideComment #4672

Silic0nS0ldier opened this issue Oct 14, 2022 · 4 comments · Fixed by #4676
Assignees

Comments

@Silic0nS0ldier
Copy link

Rollup Version

v3.1.0

Operating System (or Browser)

macOS

Node Version (if applicable)

v16.17.1

Link To Reproduction

https://github.com/Silic0nS0ldier/rollup-bug-20221014

Expected Behaviour

Build completes

Actual Behaviour

Build stalls, and never finishes.

@Silic0nS0ldier
Copy link
Author

Issues appear to have occurred in this same area in the past. #3067

Some extra info.

Original source

#!/usr/bin/env node
import "source-map-support/register.js";
async function main() {
}
main();

What is passed into findFirstLineBreakOutsideComment

#!/usr/bin/env node

@Silic0nS0ldier
Copy link
Author

Silic0nS0ldier commented Oct 14, 2022

It is possible to workaround this by changing the import, which presumably alters the string given to findFirstLineBreakOutsideComment.

e.g.

#!/usr/bin/env node
async function main() {
    await import("source-map-support/register.js");
}
main();

@lukastaegert
Copy link
Member

Thanks for the issue and the spot-on analysis! Fix at #4676.

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4676 as part of rollup@3.2.2. You can test it via npm install rollup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants