babel-node syntax error
See original GitHub issueWhen running in development babel-cli (babel-node) is throwing syntax error on CSS imports when I run my server.js. Any suggestion on how to solve this?
`products.scss: Unexpected token (1:0)
1 | .products { | ^ 2 | padding-top: 24px; 3 | padding-bottom: 24px;`
I’ve seen the suggestion to wrap css in conditional requires based on ENV, but that doesn’t seem to fit in with server side rendering concept that this plugin is solving.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Babel doesn't work in Node.js SyntaxError: Unexpected identifier
I'm hosting a nodejs project on server, that uses ES6 syntax, and I used babel-cli to compile it. I don't have any problem...
Read more >[Bug]: Unexpected Token '<' error in jsx · Issue #13926 - GitHub
In the first case, @babel/node doesn't support yet native ESM files because Node.js doesn't have a stable ESM loader API yet.
Read more >FAQ - Babel.js
Why am I getting a Syntax Error/Unexpected Token? ... It's most likely the case that you didn't include a plugin/preset that supports that...
Read more >Syntax Error: Unexpected token import using node.js-babel.js
Coding example for the question babel-node: Syntax Error: Unexpected token import using node.js-babel.js.
Read more >Why your ES6+ syntax doesn't work in Node.js and how to fix it
... came across the frustrations of coding javascript with the lovely ES6 syntax, only to be thwarted by error messages in my node...
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
Hi @koistya I am having this same issue and I’ve been dealing all day with webpack configs. Is there any simple webpack configuration that shows simple “isomophic style loading”? I think that the configs on the docs are not enough to understand how it should work and React Starter Kit config are pretty complicated to be separated from all the boilerplate. I am coming from “react-redux-universal-hot-example” that has big differences in configs and dependencies.
As far as I understand I have to compile all the server. Isn’t there any other way?
Thanks!
+1