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

Version 3.1.0 fails for certain template literals #15

Closed
stotter opened this issue Jan 15, 2019 · 2 comments
Closed

Version 3.1.0 fails for certain template literals #15

stotter opened this issue Jan 15, 2019 · 2 comments

Comments

@stotter
Copy link

stotter commented Jan 15, 2019

Version 3.1.0 of the plugin fails if it encounters the following code.

const v = 10;
const s = `${v}$`;

console.log(s); // prints: 10$
index.js → output.js...
[!] (cleanup plugin) Error: Unclosed ES6 Template Literal.
index.js (2:14)
1: const v = 10;
2: const s = `${v}$`;
                 ^
3:
4: console.log(s);
Error: Unclosed ES6 Template Literal.
    at error (C:\Users\stotter\temp\cleanup-test\node_modules\rollup\dist\rollup.js:3597:30)
    at Object.error (C:\Users\stotter\temp\cleanup-test\node_modules\rollup\dist\rollup.js:16497:17)
    at Object.error (C:\Users\stotter\temp\cleanup-test\node_modules\rollup\dist\rollup.js:16906:31)
    at Promise (C:\Users\stotter\temp\cleanup-test\node_modules\rollup-plugin-cleanup\dist\rollup-plugin-cleanup.js:119:20)
    at new Promise (<anonymous>)
    at Object.transform (C:\Users\stotter\temp\cleanup-test\node_modules\rollup-plugin-cleanup\dist\rollup-plugin-cleanup.js:113:16)
    at C:\Users\stotter\temp\cleanup-test\node_modules\rollup\dist\rollup.js:16609:25
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
    at Function.Module.runMain (module.js:696:11)

It worked fine for version 3.0.0, so this might be related to the switch from acorn to js-cleanup.

The code above works fine in firefox, chrome and node.

I've created a small repo to reproduce the error here: https://github.com/stotter/cleanup-test

@aMarCruz
Copy link
Owner

aMarCruz commented Jan 18, 2019

@stotter sorry by the delay, you found a bug!
I will fix it asap.

@aMarCruz
Copy link
Owner

@stotter , v3.1.1 in npm fixes this issue.
Thanks for your feedback!

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

No branches or pull requests

2 participants