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

babel-loader@9.1.0 - C-style commenting in JavaScript function calls is causing compilation errors. babel-loader is treating /* comments */ as unexpected tokens when they appear after => arrow functions operators. #972

Closed
knuula opened this issue Nov 6, 2022 · 9 comments

Comments

@knuula
Copy link

knuula commented Nov 6, 2022

I'm submitting a bug report

Webpack Version:
5.64.4

Babel Core Version:
7.16.0

Babel Loader Version:
9.1.0

Please tell us about your environment:
Windows 10

Current behavior:
during the compiling process, babel-loader is treating /* */ (C-style comment syntax) as unexpected tokens - causing a compiler failure.

image

image

Expected/desired behavior:

  • babel-loader should treat this type of commenting as normal commenting during the compiling process.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with a gist/jsbin of your webpack configuration.

image

image

  • What is the expected behavior?

  • babel-loader should treat this type of commenting as normal commenting during the compiling process.

  • What is the motivation / use case for changing the behavior?

  • it is causing compiler failures.

@jawn-ha
Copy link

jawn-ha commented Nov 7, 2022

same problem

@eladonline
Copy link

eladonline commented Nov 7, 2022

you can see this explained here diegomura/react-pdf#2072

@willphamsg
Copy link

same problem

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Nov 7, 2022

We will release a fix for this today. As a workaround, you can pin your @babel/generator version to 7.19

@hungdev
Copy link

hungdev commented Nov 7, 2022

but i dont use @babel/generator in my project @nicolo-ribaudo

@eladonline
Copy link

eladonline commented Nov 7, 2022

We will release a fix for this today. As a workaround, you can pin your @babel/generator version to 7.19

not working

@knuula
Copy link
Author

knuula commented Nov 7, 2022

this worked as a fix for me in package.json

image

image

@hungdev
Copy link

hungdev commented Nov 7, 2022

love you, you save me a lot of time @knuula <3
but i think this is a temporary solution

@JLHwung
Copy link
Contributor

JLHwung commented Nov 7, 2022

Duplicate of babel/babel#15132, this issue has been fixed in @babel/generator 7.20.3

@JLHwung JLHwung closed this as completed Nov 7, 2022
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

7 participants