You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the latest styled-jsx version, or any version newer than v3.3.2 will produce a fatal error in the production build (when opened in the browser): _JSXStyle is not defined.
During development everything works as expected without any error.
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
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
styled-jsx
version, or any version newer thanv3.3.2
will produce a fatal error in the production build (when opened in the browser):_JSXStyle is not defined
.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
create-react-app
.react-app-rewired
andcustomize-cra
config-override.js
:.babelrc
(same behavior when using theaddBabelPlugin
feature ofcustomize-cra
):Same error happens for this
.babelrc
config:When there is no
"plugins": ["styled-jsx/babel"]
in.babelrc
it works as expected, but then it's not possible to add plugins.yarn run build
(react-app-rewired build
) andserve -s build
- or deploy to bucket/serverUncaught ReferenceError: _JSXStyle is not defined
What is the expected behavior?
styled-jsx
should work in production the same as in development.Environment (include versions)
Did this work in previous versions?
It works with v3.3.2 but not in newer versions.
Could it be an issue with this? #684
Fix for now
import _JSXStyle from "styled-jsx/style";
for each file.3.3.2
inpackage.json
The text was updated successfully, but these errors were encountered: