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

[6.2b] ReferenceError React is not defined #14208

Closed
phaistonian opened this issue Mar 11, 2021 · 3 comments
Closed

[6.2b] ReferenceError React is not defined #14208

phaistonian opened this issue Mar 11, 2021 · 3 comments

Comments

@phaistonian
Copy link
Contributor

It seems, at least in my case, that the JSX transform is either ignored or not working (anymore?).

This Reference Error React is not defined comes up when removing React from the import.

Tried hard to pinpoint to issue, but I failed to.

Any ideas or pointers?:)

@shilman
Copy link
Member

shilman commented Mar 12, 2021

Do you have a repro repo you can share?

@phaistonian
Copy link
Contributor Author

@shilman I am afraid not since it's a (huge) private repo.

My guess is that somehow my custom webpack config is causing this, however, all I have tried has failed.

Will get back to you with any additional findings, if any.

@phaistonian
Copy link
Contributor Author

It turns out the issue was a side-effect of me using esbuild (custom webpack config) before. babel-loader.

config.plugins.push(new webpack.ProvidePlugin({
  'React': 'react',
}));

fixed it.

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

No branches or pull requests

2 participants