-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Compiling error: Did you mean to import react/jsx-runtime.js - 11.1 #27977
Comments
Also experience the same problem with |
Same error, same nextjs version, same package "react-data-grid", nodejs version 16.6.2. Problem started after migrating nextjs to 11.1.0 Unable to push changes to Vercel |
This has NOT HELPED! // next.config.js |
I found a solution but it isn't properly. I added this snippet below into the {
"type":"commonjs",
"exports":{
".":"./index.js",
"./jsx-dev-runtime":"./jsx-dev-runtime.js",
"./jsx-runtime":"./jsx-runtime.js",
"./":"./"
}
} Locally is working, but when I send it to deploy I still receiving the same error because my node_modules isn't sent. The second approach is to disable the module.exports = {
webpack5: false,
} This approach works locally and in production, so there is some issue related to Reference: |
Thanks @candidosales Unfortunately neither solution works for my project. I have opened an issue with the react-data-grid and someone there gave the same as your first solution I'm hoping someone from the Next team (😉 @timneutkens @leerob 😉) could assist us to understand how to proceed. |
I saw this solution upgrading the React to alpha version and fixed the issue: adazzle/react-data-grid#2568 npm install react@alpha react-dom@alpha Thanks @sauloquirino! |
I have same Error using, instead of |
Another way that I found to fix it is using Reference: |
face this erro too. And solved updating react and react-dom libs |
Updating react to latest did not help me, but this linked issue did: next.config.js: /** @type {import('next').NextConfig} */
const withTM = require('next-transpile-modules')(['react-data-grid']) // or whatever library giving trouble
module.exports = withTM({
reactStrictMode: true,
}) (To clarify I'm not using react-data-grid, but another library. Hopefully fix applies to react-data-grid) |
Following up on the issue links that are posted here, this is probably an issue in Upgrading to |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
11.1.0
What version of Node.js are you using?
12.22.1
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
local
Describe the Bug
After upgrading the Next to 11.1.0 isn't more possible to run my application. I'm receiving the error below:
Expected Behavior
Expect to works as before, with no errors in the compiling.
To Reproduce
Create a small project using the
react-data-grid
in the^7.0.0-beta.2
. link and next runnpm run dev
oryarn run dev
;The text was updated successfully, but these errors were encountered: