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
When I am using swc-plugin-coverage-instrument to calculate my coverage on my Next.js project,the build fails because /next-runtime-env/build/provider/env-provider.js and /next-runtime-env/build/provider/use-env-context.js have "use client" placed after "use strict".
Failed to compile.
./node_modules/next-runtime-env/build/provider/env-provider.js
Error:
× The "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue.
╭─[/Users/lustoebn/Projects/nextweb/node_modules/next-runtime-env/build/provider/env-provider.js:1:1]
1 │ "use strict";
2 │ 'use client';
· ─────────────
3 │ Object.defineProperty(exports, "__esModule", { value: true });
4 │ exports.EnvProvider = void 0;
5 │ const jsx_runtime_1 = require("react/jsx-runtime");
╰────
When I manually invert the directives in the node_modules, it works as expected.
Versions used : "swc-plugin-coverage-instrument": "0.0.24" "next-runtime-env": "3.2.2"
The text was updated successfully, but these errors were encountered:
LucasStbnr
changed the title
Build fail because "use client" placed after "use strict"
Build fails because "use client" is placed after "use strict"
Oct 3, 2024
When I am using
swc-plugin-coverage-instrument
to calculate my coverage on my Next.js project,the build fails because/next-runtime-env/build/provider/env-provider.js
and/next-runtime-env/build/provider/use-env-context.js
have "use client" placed after "use strict".Example :
The error :
When I manually invert the directives in the
node_modules
, it works as expected.My Next.js config :
Versions used :
"swc-plugin-coverage-instrument": "0.0.24"
"next-runtime-env": "3.2.2"
The text was updated successfully, but these errors were encountered: