Skip to content

Commit b57ade1

Browse files
authored
fix(nuxt): Added top-level fallback exports (#18083)
It seems that in some cases where an `environment` in Vite is set to something other than `node` or `browser`, it won't be able to figure out the correct import paths. This PR ensures that when Vite (or other tools) can't determine the environment from "browser" or "node" conditions alone, then it falls back to the server bundle similar to what we do in Next.js. In the issue's case it was set to `nuxt` or rather `vitest-environment-nuxt` which doesn't seem like a pattern to account for. closes #18070
1 parent 3deeecd commit b57ade1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/nuxt/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
"node": {
2828
"import": "./build/esm/index.server.js",
2929
"require": "./build/cjs/index.server.js"
30-
}
30+
},
31+
"import": "./build/esm/index.server.js",
32+
"require": "./build/cjs/index.server.js"
3133
},
3234
"./module": {
3335
"types": "./build/module/types.d.ts",

0 commit comments

Comments
 (0)