You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Failed to compile.
./node_modules/react-scan/dist/auto.global.js 329:96
Module parse failed: Unexpected token (329:96)
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.
| inject(o) {
| const i = ++n;
> return t.set(i, o), r._instrumentationIsActive || (r._instrumentationIsActive = !0, e?.()), i;
| },
| _instrumentationSource: u,
I have the same issue, because it contains modern JS syntax (like the logical assignment operator ||=) or possibly ES modules. I tried to configure Babel and Webpack, but I couldn't fix it. @lxsmnsyc, perhaps you've encountered this issue before?
Root cause: esbuild was building React Scan's published bundles with target: 'esnext', leaving optional chaining (?.), nullish coalescing (??), and ?.() calls in the output. Older webpack + babel-loader configs without @babel/preset-env for ES2020 fail to parse those operators when they include node_modules in the babel pipeline (CRA, etc.).
Lowered the published bundle target to es2019, which transpiles those operators down. Verified all four published bundles (auto.global.js, index.mjs, index.js, lite/index.mjs) contain 0 occurrences of ?. after the rebuild.
Activity
lxsmnsyc commentedon Feb 27, 2025
Hi, please provide an example of your setup (or any case, the setup your followed from the installation guide)
omakarov-playq commentedon May 15, 2025
I have the same issue, because it contains modern JS syntax (like the logical assignment operator ||=) or possibly ES modules. I tried to configure Babel and Webpack, but I couldn't fix it. @lxsmnsyc, perhaps you've encountered this issue before?
aidenybai commentedon May 2, 2026
Fixed in v0.5.5 via #437.
Root cause: esbuild was building React Scan's published bundles with
target: 'esnext', leaving optional chaining (?.), nullish coalescing (??), and?.()calls in the output. Older webpack + babel-loader configs without@babel/preset-envfor ES2020 fail to parse those operators when they include node_modules in the babel pipeline (CRA, etc.).Lowered the published bundle target to
es2019, which transpiles those operators down. Verified all four published bundles (auto.global.js,index.mjs,index.js,lite/index.mjs) contain 0 occurrences of?.after the rebuild.