Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module parse failed: unexpected token #212

Open
utopictown opened this issue Jan 4, 2024 · 6 comments
Open

Module parse failed: unexpected token #212

utopictown opened this issue Jan 4, 2024 · 6 comments

Comments

@utopictown
Copy link

i got this when run yarn start, what configuration that i need to implement?

./node_modules/react-helmet-async/lib/index.esm.js 374:12
Module parse failed: Unexpected token (374:12)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| var isDocument = !!(typeof window !== "undefined" && window.document && window.document.createElement);
| var HelmetData = class {
>   instances = [];
|   canUseDOM = isDocument;
|   context;

this is some of my packages that might be useful to debug

"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet-async": "^2.0.4",
"@babel/preset-env": "^7.1.0",
"@types/recordrtc": "^5.6.11",
"babel-plugin-import": "^1.7.0",
"babel-plugin-object-to-json-parse": "0.0.7",
"customize-cra": "^0.9.1",
"env-cmd": "^10.1.0",
"less-watch-compiler": "1.14.6",
"npm-run-all": "^4.1.2",
"react-app-alias": "^2.2.2",
"react-app-rewire-less": "^2.1.3",
"react-app-rewired": "^2.1.5",
"react-scripts": "^3.4.4",
@qzai666
Copy link

qzai666 commented Jan 23, 2024

me too

@Petar-Pankov
Copy link

Anything on that?

@LSauter68140
Copy link

I got the same error with

    "react-helmet-async": "^2.0.4",,
    "react": "^17.0.2",
    "react-dom": "^17.0.2",

I tried to downgrade and the first version that works is :

"react-helmet-async": "^1.3.0"

is not a perfect but for now is the better solution I found

@mvaldetaro
Copy link

+1

@agata
Copy link

agata commented May 27, 2024

me too

@mrsarm
Copy link

mrsarm commented Dec 3, 2024

This issue persist. We have a project with Typescript 4.2, and even upgrading many of the dependencies and dev dependencies, including Typescript to version 5.0.4, the only workaround is to downgrade react-helmet-async as suggested by @LSauter68140 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants