Closed oritwoen closed 2 years ago
i get this error with yarn
after yarn preview
or node .output/server/index.mjs
- Operating System: `Darwin`
- Node Version: `v18.1.0`
- Nuxt Version: `3.0.0-rc.3`
- Package Manager: `yarn@1.22.15`
- Builder: `vite`
- User Config: `modules`, `runtimeConfig`, `nitro`, `vite`, `sourceMap`
- Runtime Modules: `nuxt-graphql-client@0.0.24`
- Build Modules: `-`
(node:95748) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/denisnikonov/projects/nuxt-text/.output/server/node_modules/node-fetch/src/index.js:9
import http from 'node:http';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1033:15)
at Module._compile (node:internal/modules/cjs/loader:1069:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Module._load (node:internal/modules/cjs/loader:827:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:170:29)
at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:409:24)
Node.js v18.1.0
@ririen @DenisNikonov This was addressed upstream and should now be working without issue for you.
be sure to delete your lockfile (yarn.lock
or package-lock.json
) and ensure that your new lockfile uses unenv >= 0.5.2
& nitropack => 0.4.4
, this can be verified for yarn by running yarn why unenv
@Diizzayy It works! Thank you for your work
With
pnpm
afterpnpm build
and thenpnpm preview
crashes with strange errors. Withyarn
everything works fine.Linux
v18.1.0
3.0.0-rc.3
pnpm@7.0.1
vite
runtimeConfig
,css
,modules
,vueuse
,schemaOrg
,unocss
,experimental
@vueuse/nuxt@8.4.2
,@unocss/nuxt@0.33.2
,nuxt-schema-org@0.5.2
,nuxt-graphql-client@0.0.25
Build Modules:
-