Unexpected token
See original GitHub issueMy scss file
:local(.styles) {
position: relative;
padding: 50px 0;
.tool {
text-align: center;
margin: 30px 0;
img {
width: 80%;
}
}
}
my loader
{
test: /\.scss$/,
loader: 'style!css!sass'
}
and error
[1] SyntaxError: /home/max/projects/tradeintelclient/src/components/header.scss: Unexpected token (1:0)
[1] > 1 | :local(.styles) {
[1] | ^
[1] 2 | position: relative;
[1] 3 |
[1] 4 | padding: 50px 0;
[1] at Parser.pp.raise (/home/max/projects/tradeintelclient/node_modules/babylon/index.js:1425:13)
[1] at Parser.pp.unexpected (/home/max/projects/tradeintelclient/node_modules/babylon/index.js:2907:8)
[1] at Parser.pp.parseExprAtom (/home/max/projects/tradeintelclient/node_modules/babylon/index.js:754:12)
[1] at Parser.parseExprAtom (/home/max/projects/tradeintelclient/node_modules/babylon/index.js:4370:22)
[1] at Parser.pp.parseExprSubscripts (/home/max/projects/tradeintelclient/node_modules/babylon/index.js:509:19)
[1] at Parser.pp.parseMaybeUnary (/home/max/projects/tradeintelclient/node_modules/babylon/index.js:489:19)
[1] at Parser.pp.parseExprOps (/home/max/projects/tradeintelclient/node_modules/babylon/index.js:420:19)
[1] at Parser.pp.parseMaybeConditional (/home/max/projects/tradeintelclient/node_modules/babylon/index.js:402:19)
[1] at Parser.pp.parseMaybeAssign (/home/max/projects/tradeintelclient/node_modules/babylon/index.js:365:19)
[1] at Parser.pp.parseExpression (/home/max/projects/tradeintelclient/node_modules/babylon/index.js:329:19)
[1]
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
syntax error: unexpected token - javascript - Stack Overflow
The error SyntaxError: Unexpected token < likely means the API endpoint didn't return JSON in its document body, such as due to a...
Read more >Have a JavaScript Unexpected Token Error? Check Your Syntax
The JavaScript's parser expects tokens and symbols in a particular order, with relevant values or variables in between. Often, an Unexpected ...
Read more >JavaScript Error Handling: Unexpected Token - GeeksforGeeks
Not follow them throws an error.An unexpected token occurs if JavaScript code has a missing or extra character { like, ) + –...
Read more >Unexpected token - Common causes and quick fixes - Opster
Unexpected token – How to solve this Elasticsearch error. Opster Team. July-20, Version: 1.7-8.0. Before you ...
Read more >How to fix: "SyntaxError: Unexpected token" in JavaScript
There are a number of causes for the SyntaxError: Unexpected token error in JavaScript. typically, the error is caused by a typo or...
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 Free
Top 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
@bipinshashi Adding this code near the top of my webpack config fixed it for me:
require.extensions['.scss'] = () => { return; }; require.extensions['.css'] = () => { return; };
Hope that helps!
@stigmat4j What language is this? Is
:local
legal in Sass?@storrdev @rickhanlonii @bipinshashi Looks like you were trying to import stylesheets in node. Maybe you’re writing an isomorphic app? I would recommend to compile your node app with webpack too (using the
node
target option)