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.

Unexpected token windows

See original GitHub issue

I’ve used this loader with great success on Linux/MacOS, but when I try to use it on Windows, I get this type of error message on all my SVG files:

ERROR in ./src/client/images/icons/ic_description_black_48px.svg
Module parse failed: C:\Users\<path>\src\client\images\icons\ic_description_black_48px.svg Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (1:0)
    at Parser.pp$4.raise (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:2221:15)
    at Parser.pp.unexpected (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:603:10)
    at Parser.pp$3.parseExprAtom (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:1822:12)
    at Parser.pp$3.parseExprSubscripts (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:1597:21)
    at Parser.pp$3.parseExpression (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:1573:21)
    at Parser.pp$1.parseStatement (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:727:47)
    at Parser.pp$1.parseTopLevel (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:638:25)
    at Parser.parse (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:516:17)
    at Object.parse (C:\Users\<path>\node_modules\webpack\node_modules\acorn\dist\acorn.js:3098:39)
    at Parser.parse (C:\Users\<path>\node_modules\webpack\lib\Parser.js:902:15)
    at DependenciesBlock.<anonymous> (C:\Users\<path>\node_modules\webpack\lib\NormalModule.js:104:16)
    at DependenciesBlock.onModuleBuild (C:\Users\<path>\node_modules\webpack-core\lib\NormalModuleMixin.js:310:10)
 @ ./src/client/components/policies/policy/PolicyHistory.jsx 57:33-95

What could be the issue here?

Using "svg-sprite-loader": "0.0.15", npm -v 3.10.3 node -v 6.5.0

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kisenkacommented, Nov 21, 2017

@ophite try to use path.resolve instead of path.join

1reaction
ophitecommented, Nov 21, 2017

I have this bug on windows 10, npm 5.4.2, node 8.7, not help /\.(svg)$/i

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm ERR! Unexpected token '.' with with nvm-windows ...
Under Windows environments, the problem is related to symbolic links that are wrongly created as hard files. For example: nodejs/node_modules/ ...
Read more >
unknown error on npm install "npm ERR! Unexpected ...
I need to do testing in Node v17 for a specific bug, so just using the older versions of Node isn't a viable...
Read more >
Connect-SPOService Unexpected token error
I know unexpected token errors usually mean a syntax error but 'center' literally doesn't exist. I suspect it has something to do with...
Read more >
Issue with "unexpected token" error - TechNet - Microsoft
Hi I am new in PowerShell and I a trying to write a script for discovering the AD computers Outdated accounts.
Read more >
powershell - unexpected toekn in expression or statement
I am receiving he following parser error for line below >>foreach ($file in $folder.files)}. error: "unexpected token 'in' in expression 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