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.

babel-node syntax error

See original GitHub issue

When 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:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
anaibolcommented, May 28, 2016

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!

0reactions
SudoPlzcommented, Aug 11, 2016

+1

Read more comments on GitHub >

github_iconTop 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 >

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