mxstbr.com icon indicating copy to clipboard operation
mxstbr.com copied to clipboard

Failed to compile on npm run dev

Open arso1er opened this issue 6 years ago • 2 comments

Hi,

So I cloned your repo and tried to run npm run dev after installing the dependencies. But when I try to access http://localhost:3000, I get this error: Failed to compile ./components/Card.js TypeError: Property expression of JSXExpressionContainer expected node to be of a type ["Expression","JSXEmptyExpression"] but instead got null at Array.reduce (<anonymous>) This error occurred during the build time and cannot be dismissed.

Any idea what the problem is?

arso1er avatar Oct 14 '19 11:10 arso1er

I think it's because object rest spread into the css prop no longer works in the latest styled-components Babel plugin version: https://github.com/styled-components/babel-plugin-styled-components/issues/235

Can you try downgrading that? :pray: Thank you!

mxstbr avatar Oct 14 '19 11:10 mxstbr

Thanks for your answer.

Using the link you provided, this is what I did: I uninstalled babel-plugin-styled-components and installed version 1.10.0. Now the dev server is working fine.

I then added two more scripts to build and start: "next build" and "next start". When I run the build script, everything is compiled successfully, but when I run the start script, I get the following error in the terminal: TypeError: Cannot read property 'background' of undefined at \mxstbr.com-master\.next\server\static\cwyZTCDcU2fT0Tr_tr6dV\pages\_app.js:567:29 It seems the problem is comming from props.theme.colors.background.

arso1er avatar Oct 14 '19 13:10 arso1er