-
Notifications
You must be signed in to change notification settings - Fork 262
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
Support Node.js ESM #640
Comments
jaydenseric
added a commit
to jaydenseric/styled-jsx
that referenced
this issue
May 12, 2020
Fixes vercel#640 .
Draft
Another few things to support Node.js ESM:
|
In the latest release we introduced this option https://github.com/zeit/styled-jsx#stylemodule |
Nope. |
It's a hack but I'm currently working around this bug by running sed -i '' 's/"styled-jsx\/style"/"styled-jsx\/style.js"/g' build/* Sharing here in case it helps save someone else some time. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
The
styled-jsx/babel
Babel plugin is incompatible with Node.js ESM in two ways, relating to mandatory file extensions:styled-jsx
deep imports, e.g.import css from 'styled-jsx/css'
works butimport css from 'styled-jsx/css.js'
doesn't.import _JSXStyle from 'styled-jsx/style'
.If the current behavior is a bug, please provide the steps to reproduce and possibly a minimal demo or testcase in the form of a Next.js app, CodeSandbox URL or similar
For the first issue:
In
demo-1.mjs
:Try to transpile that file with the
styled-jsx/babel
Babel plugin, and note that it did not do any transformations.For the second issue:
In a project with
styled-jsx
installed, indemo-2.mjs
:Run with a current Node.js version (e.g. v14.2):
And note the crash:
What is the expected behavior?
The
styled-jsx/babel
Babel plugin should expect, and produce, ESM compatible with Node.js.Environment (include versions)
Did this work in previous versions?
Doubt it.
The text was updated successfully, but these errors were encountered: