styled-jsx css.resolve errors after upgrading to React 17.0.0/Next 9.5.5
See original GitHub issueBug report
Describe the bug
After upgrading our Next.js application to React 17.0.0
and Next.js 9.5.5
, our builds are failing with the following TypeError when parsing styled-jsx’s resolve
calls:
TypeError: pass.get(...) is not a function
This only seems to happen when resolve
is called outside of a jsx/tsx file. You can see a working example here: https://codesandbox.io/s/elegant-bassi-tbx5c?file=/pages/index.tsx (as opposed to the reproduction sandbox below).
I’m struggling to find the cause of these errors, as this pattern is working fine for us on React 16.x
and Next.js 9.5.5
. Could this be due to the new JSX transform support?
To Reproduce
CodeSandbox reproduction:
https://codesandbox.io/s/nice-bose-85uux?file=/lib/styles.ts
Expected behavior
The build should succeed without errors.
System information
- OS: any
- Version of Next.js:
9.5.5
- Version of Node.js:
10.20.1
/12.11.1
Additional context
N/A
Issue Analytics
- State:
- Created 3 years ago
- Reactions:14
- Comments:14 (2 by maintainers)
Top Results From Across the Web
styled-jsx - npm
Full CSS support for JSX without compromises. Latest version: 5.1.1, ... Start using styled-jsx in your project by running `npm i styled-jsx`.
Read more >Use styled-jsx without ejecting create-react-app - Stack Overflow
According to the styled-jsx docs, it can be used in create-react-app by using the css.resolve function provided in styled-jsx/macro .
Read more >Next.js 4: React 16 and styled-jsx 2 - Vercel
We are happy to introduce Next.js 4, which features support for React 16 and introduces a major upgrade for the default styling engine ......
Read more >Compare Packages Between Distributions - DistroWatch.com
Please select two distributions and then a specific version of each distribution to compare. ... adobe-reader-9.5.5 ... aeson-better-errors-0.9.1.1
Read more >Styling Next.js with Styled JSX
Styled JSX is a CSS-in-JS library that allows you to write encapsulated and scoped CSS to style your components. This blog post will...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Don’t know if I’m much help, but I’m getting the same error after I installed
babel-plugin-inline-react-svg
.This breaks (
pass.get(...) is not a function
):While this works:
@Timer can we reopen this?