I can no longer run gatsby develop after updating the CLI.
run gatsby develop
Should run develop fine
ERROR #98124 WEBPACK
Generating SSR bundle failed
Can't resolve 'react/jsx-runtime.js' in '/Users/joetaylor/Documents/www/joebentaylor/.cache'
If you're trying to use a package make sure that 'react/jsx-runtime.js' is installed. If you're trying to use a local file make sure that the path is correct.
File: .cache/develop-static-entry.js
System:
OS: macOS 10.15.7
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.19.0 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.14.8 - /usr/local/bin/npm
Languages:
Python: 2.7.15 - /usr/local/bin/python
Browsers:
Chrome: 86.0.4240.80
Edge: 83.0.478.54
Firefox: 80.0.1
Safari: 14.0
npmGlobalPackages:
gatsby-cli: 2.12.107
gatsby: 2.24.77
Hi!
Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.
If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.
Thanks for using Gatsby! 馃挏
Facing the same issue.
Edit: @joebentaylor1995, seems to go away when I revert back to [email protected] from [email protected].
Can confirm.
Same problem.
Do you still have this with the latest gatsby? Try removing node_modules, package-lock.json and try installing again.
@wardpeet Tried that several times with no luck, ill try your option @ttstauss
I think it's an issue with React (jsx-transform): https://github.com/facebook/react/issues/20036
Out of curiosity. @ttstauss @i-bsd do you have the Preact plugin installed?
I just removed mine and i can now build, nopw just to get the transition link bug fixed and im fully back, maybe reverting gatsby version may help me...
@joebentaylor1995 Yes but disabled earlier today.
@joebentaylor1995 I had a weird issue today where I couldn't run gatsby develop (it would just show a blank white screen with no error messages or console output). Disabled preact and it worked.
But I still can't use the latest version of React with the jsx-transform thing. Had to downgrade to previous version.
Yeah ive disabled it from my gatsby config and i can now build. this is a crazy issue
@joebentaylor1995 Just to clarify - are you using latest version [email protected] with preact disabled, and everything works?
I think it's an issue with React (jsx-transform): facebook/react#20036
What makes you think there's an issue in React? The issue you're linking to has no reproducing case so it's likely a configuration problem in the reporter's setup. We didn't close it out of courtesy for now, but there's nothing there that indicates a React problem.
@joebentaylor1995, yes I have Preact installed. I updated gatsby-plugin-preact to 4.0.16 from 4.0.15 and React back to 16.14.0 from 16.13.1. I also upgraded gatsby from 2.24.78 to 2.24.80. So far I've been able to build successfully with these changes.
It seems like the common thread is that you use React in development and Preact in production. To me, this sounds like an extremely fragile setup because Preact is known to have behavior differences and incompatibilities with React, but that's your call. What I think is happening here is that Gatsby detects React supports the new JSX transform (so it uses it), but it isn't aware of the Preact override, and I think maybe Preact doesn't support it yet (?)
One hour ago there was an update to Preact but sadly the problem still persists. I'm not sure whether the problem is caused by preact or by gatsby-plugin-preact. For now the best workaround is to pin react and react-dom to "<16.14.0" until the issue gets resolved.
I've installed [email protected] with [email protected] and [email protected] and I don't get an issue. We published a fix where we rollbacked the automatic jsx part
In my case, it is the MDX plugin that does not find the jsx runtime:
Can't resolve 'react/jsx-runtime' in '.../node_modules/gatsby-plugin-mdx'
Any idea @wardpeet on that?
@tujoworker have you updated all packages?
React 17 is currently not yet fully supported with Gatsby as the ecosystem hasn't updated yet.
This has been mentioned in other issues here.
I would stay with version 16 until the ecosystem has matured a little bit more, which will probably happen in a week or more.
I'm going to close this, as it should be fixed now. If anyone can reproduce it with the latest version of gatsby, please can you share a minimal reproduction and reopen.
Most helpful comment
Facing the same issue.
Edit: @joebentaylor1995, seems to go away when I revert back to [email protected] from [email protected].