Module build failed: SyntaxError: Unexpected token (1:1)
See original GitHub issueIf I specify plugin config in .babelrc
it throws the error.
ERROR in ./src/pages/Application.js
Module build failed: SyntaxError: c:/dev/.../Application.js: Unexpected token (1:1)
> 1 | import React, { Component } from 'react'
| ^
{
"presets": ...,
"plugins": [
...,
["inline-react-svg", {
"svgo": false
}]
]
}
If I then use just "inline-react-svg"
in .babelrc
then it doesn’t throw the error.
But in the default mode it discards half of <svg/> attributes like stroke-width="2.5"
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:17
Top Results From Across the Web
Module build failed: SyntaxError: Unexpected token
I a encountering an weired error and this leaves me perplexed! To my understanding nothing wrong in the syntax in index.jsx which is...
Read more >Module build failed: SyntaxError: Unexpected token m #13
This issue occurs when applying the json-loader twice. i. e. by using configuration + require("json! . That's wrong. #11 is only a workaround,...
Read more >Get Started - Hashnode
And I'm getting error: Here is my webpack.config.js file, ... ERROR in ./index.js Module build failed: SyntaxError: Unexpected token.
Read more >Why am I getting Module build failed: SyntaxError - Vue Forum
Why am I getting Module build failed: SyntaxError: Unexpected token, expected? ... I am doing it in computed and getting this error because...
Read more >Module build failed: SyntaxError: Unexpected token, expected
Uncaught Error: Module build failed: SyntaxError: Unexpected token, expected ; (4:4). I am getting this error in console and i cannot compile using...
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
@ljharb - I can confirm I experience a similar issue.
"babel-plugin-inline-react-svg": "~0.5.4",
And a very simple .babelrc:
When setting
svgo:false
my application produces: SyntaxError: Unexpected token (1:1) in the console as well.hmm. honestly i dont know that that is my issue. i’m going to just retract my comment, please ignore it. thanks for the response.
On Mon, Jul 2, 2018 at 3:09 AM Jordan Harband notifications@github.com wrote: