question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React 17: Property expression of JSXExpressionContainer expected node to be of a type ["Expression","JSXEmptyExpression"] but instead got undefined

See original GitHub issue

Bug report

Describe the bug

In a Next.js project using styled-jsx I get the following error across different components that create a <style jsx> tag to generate CSS selectors within template literals (or import such styles from a separate file):

Property expression of JSXExpressionContainer expected node to be of a type ["Expression","JSXEmptyExpression"] but instead got undefined

The error appears as soon as I update react and react-dom to 17.0.0 and might be related to the new JSX transform in React v17.

Expected behavior

It renders the component as expected without any errors.

System information

  • OS: macOS Catalina
  • Version of React: 17.0.0
  • Version of Next.js: 9.5.5
  • Version of Node.js: 12.18.3
  • Version of TypeScript: 4.0.3

Additional context

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
messagecommented, Oct 22, 2020

Uhm, rm -rf yarn.lock yarn-error.log node_modules/ build/ .next/ && yarn install && yarn dev fixed my issue 🤔 @jakeherp

0reactions
balazsorban44commented, Jan 29, 2022

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Property expression of ExpressionStatement expected ...
But I am facing the below error while trying to build it using ./gradlew assembleRelease. @babel/template placeholder "$1": Property expression ...
Read more >
JSX In Depth
The first part of a JSX tag determines the type of the React element. Capitalized types indicate that the JSX tag is referring...
Read more >
Useful Patterns by Use Case - React TypeScript Cheatsheets
Wrapping/Mirroring a HTML Element​. Usecase: you want to make a <Button> that takes all the normal props of <button> and does extra stuff ......
Read more >
Issues in react-router when import any component in my ...
yo @microsoft/sharepoint (use react framework and client site type is WebPart). npm install react roter-dom. import BrowserRouter from react- ...
Read more >
How to Read React Errors (fix 'Cannot read property of ...
Got an error like this in your React component? Cannot read property `map` of undefined. In this post we'll talk about how to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found