ModuleParseError: Module parse failed: Unexpected token (17:2)
See original GitHub issueI have recently experienced the following error during gatsby develop
after upgrading theme-ui to v0.13.1 inside my Gatsby theme.
ModuleParseError: Module parse failed: Unexpected token (17:2)
You may need an appropriate loader to handle this file type, currently no loaders are
configured to process this file. See https://webpack.js.org/concepts#loaders
|
| export const wrapRootElement = ({ element }) => (
> <WrapRootElement element={element} />
| )
|
This was never an issue with v0.12 or any other previous versions.
I am using Gatsby themes in my project and I have theme-ui
, gatsby-plugin-theme-ui
, and other plugins installed inside my theme and not inside the project itself.
I was able to solve this issue by installing gatsby-plugin-theme-ui
inside my Gatsby site and removing it from my theme.
Not sure why I’m now having this error, maybe its related to the breaking changes in v0.13?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Module parse failed: Unexpected Token. You may need an ...
The error comes from this line: return <h1>React App</h1> , because <h1>...</h1> is not valid javascript. Even if rename this is would be ......
Read more >Module parse failed: Unexpected token. You may ... - GitHub
This is a library build issue. We moved to ts3.8 without thinking about optional chaining transpiling. Here seems like a correct way to...
Read more >Odyssey Lift-off I: "Module parse failed: Unexpected token" Error
Hello,. I am on the “useQuery hook” step attempting to implement the grid. Here is my code that I think is problematic:
Read more >Module parse failed: Unexpected token (1:0) - Laracasts
Hello , After running npm run watch I see this error : ERROR in ./resources/js/components/irp/admin/EditGroup.vue 1:0 Module parse failed: Unexpected token ...
Read more >[Help] Module parse failed: Unexpected token . Babel not ...
npm install and make get many similar errors like the following. ERROR in ./node_modules/react-native/Libraries/Animated/src/Easing.js 64:16 ...
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 FreeTop 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
Top GitHub Comments
Awesome! That confirms my suspicion. We need to transpile all JSX in the plugin to make it work as a nested dependency.
I’m considering doing this manually, but it may be a bit error prone — we’d have to make sure nobody uses JSX there again — so it might be better to just do it with
tsc && prettier
.@hasparus -
That is the entire error message when I follow the Gatsby Theming Tutorial. I have copy and pasted everything from the tutorial so as to avoid mistyping.