-
Notifications
You must be signed in to change notification settings - Fork 672
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
[0.6] Attempted import error: 'createElement' is not exported from 'theme-ui' (imported as '_createElement'). #1382
Comments
@alex83130 - it should work, the next.js example in the theme-ui repo is using next.js v 10 as well and it works fine. I suspect the error is from the rendered page, not so much from the _app.js file. Can you check the specific page that gives you this error, or do you have a repo we can take a look at? |
I have created a Codesandbox to try to reduce the problem. Didn't success to get the same error but the sx style does not seem to be taken into account. |
I succeeded to make it work when I downgraded theme-ui to 0.4.0-rc.14 (as in your next JS example) and using :
I met another issue : |
@alex83130 - you don't need to go back to 0.4: here is an updated version of your example |
Umm strange, everything works well with theme-ui 0.6.0-alpha.4 and
But as soon as I remove the And when I replace both lines by :
I get |
@alex83130 - the automatic runtime should work with Can you share an example and we will investigate. |
But this is a digression, I think I have a solution. The error message seemed odd to me. We don't export https://babeljs.io/docs/en/babel-plugin-transform-react-jsx I opened Next's Babel preset, and it looks like there's a conflict with Next.js Babel config, and that https://github.com/vercel/next.js/blob/canary/packages/next/build/babel/preset.ts#L134-L145 Configuring automatic runtime in |
I think this issue needs a change in the docs and Next.js example on our side. We need to state clearly that
@dcastil @lachlanjc what do you think about it? Does it make sense? |
I also think we should clarify it in the docs. The situation with the two JSX runtimes is really confusing unfortunately. |
Yep, we should totally cover this. As of now I don't understand all the moving parts of this well enough to write thorough documentation, but if someone else wants to get some docs started, I'd be happy to review/edit/contribute. |
|
I have applied the runtime config on
Then I have replaced all
by
That works well except for the |
Btw I have noticed that there is a
But in my case I get that message : |
I have similar problem and I wrote a comment about it on the MDX repo: mdx-js/mdx#1014 (comment). Seems related. |
We've significantly improved documentation on our JSX pragma, over here: https://theme-ui.com/guides/jsx-pragma Going to close this for now, but please flag if there's improvements we should make! |
Describe the bug
In order to be able to install Next v10 (which work on React v17), I tried to include the latest theme-ui's alpha version v0.6.0-alpha.4 and make them work together.
I will surely reverse my changes since theme-ui v0.6 is not in released yet, but I wanted just let you know that I have met this error during the npm running :
And that happen only when I put
Component
(which take the current dynamic route in Next):If
Component
is commented, then I can see the rest of the page working well (The Header and Footer provided by the Layout)I'm wondering if I have missed something or if there is a bug from theme-ui
Expected behavior
Don't have that error and see the page display well
Additional context
The text was updated successfully, but these errors were encountered: