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

js-tokens doesn't support private identifiers (#foo) #23

Open
o0101 opened this issue Sep 17, 2021 · 3 comments
Open

js-tokens doesn't support private identifiers (#foo) #23

o0101 opened this issue Sep 17, 2021 · 3 comments
Labels
bug Something isn't working js preprocess

Comments

@o0101
Copy link

o0101 commented Sep 17, 2021

Hello @lifthrasiir

I ran

$ npx roadroller src/bang.js

on this file: https://github.com/i5ik/BANG/blob/799c5ed70bf0585b11024a1597f21fe5691ead74/src/bang.js

And received this output:

Error: invalid JS code in the input

The file src/bang.js runs correctly in the browser (as you can see)

Above, I ran roadroller on Node v14.17.6

Below, I used nvm to try node v16.9.1 and re-installed roadroller@latest and ran with -v and got the same error as well as

Actual memory usage: 145.9 MB (out of 150 MB)
Error: invalid JS code in the input

I tried with more memory --M and had

Actual memory usage: 600.8 MB (out of 1000 MB)
Error: invalid JS code in the input

Just leaving this report here for information.

Thank you again for this library!

@lifthrasiir
Copy link
Owner

It seems that the current version of js-tokens does not yet support private identifiers (#foo). I can update js-tokens if the upstream got a support for that. Note that Roadroller bundles its own version of js-tokens to aid the minification, so the update requires a manual process.

Meanwhile you can disable JS preprocessing by -t text -a eval, which should work for any input at the expense of compression ratio.

@lifthrasiir lifthrasiir changed the title "Error: invalid JS code in the input" js-tokens doesn't support private identifiers (#foo) Sep 17, 2021
@lifthrasiir lifthrasiir added the bug Something isn't working label Sep 17, 2021
@lifthrasiir
Copy link
Owner

For now I'll keep this open because there might be a workaround without updating js-tokens.

@o0101
Copy link
Author

o0101 commented Sep 17, 2021

thank you very much. I'll probably experiment with a couple of different workarounds including the ones you suggest as well I will try replacing the private member syntax with some other syntax. thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working js preprocess
Projects
None yet
Development

No branches or pull requests

2 participants