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.

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

github_iconTop GitHub Comments

3reactions
storrdevcommented, Apr 15, 2016

@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!

1reaction
jhnnscommented, Jun 26, 2016

@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)

Read more comments on GitHub >

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

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