Support React Automatic Runtime #922
Replies: 3 comments
-
Thanks! Not surprised to hear that this isn't working, you may be the first person to test this. If you feel comfortable playing around with the Snowpack source code, it would be great to add some debug logging to this behavior. Most of it happens in this file: https://github.com/pikapkg/snowpack/blob/master/snowpack/src/rollup-plugins/rollup-plugin-wrap-install-targets.ts You can see we already throw an error if namedExports handling fails: https://github.com/pikapkg/snowpack/blob/master/snowpack/src/rollup-plugins/rollup-plugin-wrap-install-targets.ts#L11 I'd recommend adding a That would be a great improvement for anyone else who hits this issue, and should hopefully help us find out what's going wrong here as well. |
Beta Was this translation helpful? Give feedback.
-
The @babel/plugin-transform-react-jsx plugin doesn't support 'automic' mode well. I think it's not a problem of snowpack. Please try this plugin in plain babel transform. |
Beta Was this translation helpful? Give feedback.
-
For example, |
Beta Was this translation helpful? Give feedback.
-
Currently, if you try to enable React Automatic Runtime in
babel.config.json
,snowpack dev
will fail with errorNext, if you do what this message says, the build itself will no longer fail, but the code still won't work, throwing this error in a browser
I thought adding
would resolve the issue, but it didn't.
snowpack build
, on the other hand, produces working code, even if you don't addreact/jsx-runtime
toinstall
andinstallOptions.installOptions
.Repo to reproduce the issue: https://github.com/kevindetry/snowpack-react-automatic-runtime
Beta Was this translation helpful? Give feedback.
All reactions