staylor / react-helmet-async

Thread-safe Helmet for React 16+ and friends
Apache License 2.0
2.12k stars 154 forks source link

Module parse failed: unexpected token #212

Open utopictown opened 10 months ago

utopictown commented 10 months ago

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 commented 9 months ago

me too

Petar-Pankov commented 8 months ago

Anything on that?

LSauter68140 commented 7 months ago

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 commented 6 months ago

+1

agata commented 5 months ago

me too