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

@jsx pragma broken in latest versions of babel-loader & @babel/core #14189

Closed
MartinSoderholm opened this issue Jan 20, 2022 · 4 comments
Closed
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@MartinSoderholm
Copy link

I'm submitting a bug report

Webpack Version:
5.66.0

Babel Core Version:
7.16.10

Babel Loader Version:
8.2.3

Please tell us about your environment:
macOS 12.1
node.js 16.9.0

Current behavior:
/** @jsx jsxCreateModel */ pragma is ignored and transpiled code has React.createElement(.... Error React is not defined is thrown.

Expected/desired behavior:
/** @jsx jsxCreateModel */ pragma should result in transpiled code with my custom method jsxCreateModel(....

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.

I tried downgrading various packages, and to get it working I had to revert to @babel/core 7.15.5 and babel-loader 8.2.2. Only upgrading core to 7.16.0 breaks it. Only upgrading the loader to 8.2.3 breaks it. Upgrading both of them breaks it.

@JLHwung JLHwung transferred this issue from babel/babel-loader Jan 20, 2022
@babel-bot
Copy link
Collaborator

Hey @MartinSoderholm! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@JLHwung
Copy link
Contributor

JLHwung commented Jan 20, 2022

I can't reproduce this issue. Are you sure the pragma comment is /** @jsx jsxCreateModel */? In #14012 we limits the @jsx pragma comment, i.e. /** some thing @jsx jsxCreateModel */ is not allowed. But /** @jsx jsxCreateModel */ is still supported.

@MartinSoderholm
Copy link
Author

I was about to say “Yes, I'm sure”, but then I checked and apparently it was /** @jsx jsxCreateModel **/, for some reason.

So I guess the ending **/ is no longer supported 😊.

Thanks for your help 👍

@nicolo-ribaudo
Copy link
Member

Uh well, we should probably add it back since it doesn't seem too uncommon (especially because multiline dockblock comments end with **/).

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Apr 23, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

4 participants