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

Label being incorrectly removed with treeshaking disabled #3473

Closed
guybedford opened this issue Mar 30, 2020 · 4 comments · Fixed by #3492
Closed

Label being incorrectly removed with treeshaking disabled #3473

guybedford opened this issue Mar 30, 2020 · 4 comments · Fixed by #3492

Comments

@guybedford
Copy link
Contributor

Expected Behavior

There are three labeled while loops in the build with loop: names.

When running the build with treeshaking enabled, all three labels remain in the output.

Actual Behavior

When running the build with treeshaking disabled, the first loop: label is removed! As a result the internal break loop fails further parsing.

@guybedford
Copy link
Contributor Author

@lukastaegert any ideas why this might be happening?

@lukastaegert
Copy link
Member

It is hard to reduce the test case

@guybedford
Copy link
Contributor Author

Thanks for taking a look - I've managed to isolate it down to three files in a circular reference that use the same label name, where one of the files contains a function from the other. The isolation at https://github.com/guybedford/rollup-label-bug/blob/master/tokenize-string.js now builds the local file directly. It's definitely a complex case - but the fact remains a valid label (and the code is definitely valid) should not be removed when treeshaking is disabled.

lukastaegert added a commit that referenced this issue Apr 9, 2020
…iables, always inlcude labels when not treeshaking, resolves #3473
@lukastaegert
Copy link
Member

Managed to solve it, fix at #3492

lukastaegert added a commit that referenced this issue Apr 9, 2020
…iables, always inlcude labels when not treeshaking, resolves #3473
lukastaegert added a commit that referenced this issue Apr 9, 2020
…iables, always inlcude labels when not treeshaking, resolves #3473 (#3492)
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.

2 participants