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.

Invalid or unexpected token for styles import

See original GitHub issue

Bug report

ready - started server on http://localhost:3000
error - ./assets/scss/nextjs-material-kit.scss
C:\Users\Benjo\MTA\node_modules\style-loader\node_modules\schema-utils\dist\validate.js:1

SyntaxError: Invalid or unexpected token

Describe the bug

I keep getting “Syntax Error: Invalid or unexpected token” whenever I import my scss stylesheet globally in _app.js. It just brought this error all of a sudden.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Start dev server

Expected behavior

Compiled successfully

System information

  • OS: Windows
  • Version of Next.js: 9.3.5
  • Version of Node.js: 13.12.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Onibenjocommented, Oct 26, 2020

style loader located in node_modules, it was a temporal fix at the time but i assume everything works fine now

0reactions
balazsorban44commented, Jan 29, 2022

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jest unexpected token when importing css - Stack Overflow
The problem is that Jest is hitting these CSS imports and trying to parse them ... SyntaxError: Invalid or unexpected token > 1...
Read more >
Invalid or unexpected token for styles import #12611 - GitHub
Describe the bug. I keep getting "Syntax Error: Invalid or unexpected token" whenever I import my scss stylesheet globally in _app.js.
Read more >
SyntaxError Invalid or unexpected token - How to SSR images ...
I'm using SSR to render a react component which should import an image. ... I get an error "SyntaxError: Invalid or unexpected token"....
Read more >
Uncaught SyntaxError: Invalid or unexpected token
Console is showing this error after turning on minify css: Uncaught SyntaxError: Invalid or unexpected token. Looking at the source the error is...
Read more >
SyntaxError: Unexpected token - JavaScript - MDN Web Docs
What went wrong? A specific language construct was expected, but something else was provided. This might be a simple typo. Examples ...
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