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
npm i -D naive-ui import { NCarousel } from 'naive-ui'
npm run dev -- -o
Expected results (期望的结果)
正常引入,支持 ssr
Actual results (实际的结果)
(node:2320) 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)
Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at ModuleWrap. (node:internal/modules/esm/translators:196:29)
at ModuleJob.run (node:internal/modules/esm/module_job:183:25)
at async Loader.import (node:internal/modules/esm/loader:178:24)
at async instantiateModule (file:///D:/Qsync/workspace/guanwang/nuxt-app/.nuxt/dist/server/server.mjs:2717:3)
TuSimple/naive-ui version (版本)
2.19.11
Vue version (Vue 版本)
3.2.20
Browser and its version (浏览器及其版本)
chrome 93
System and its version (系统及其版本)
Windows 11
Node version (Node 版本)
16
Reappearance link (重现链接)
https://github.com/nuxt/nuxt.js
Reappearance steps (重现步骤)
npm i -D naive-ui
import { NCarousel } from 'naive-ui'
npm run dev -- -o
Expected results (期望的结果)
正常引入,支持 ssr
Actual results (实际的结果)
(node:2320) 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)Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1031:15)
at Module._compile (node:internal/modules/cjs/loader:1065:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at ModuleWrap. (node:internal/modules/esm/translators:196:29)
at ModuleJob.run (node:internal/modules/esm/module_job:183:25)
at async Loader.import (node:internal/modules/esm/loader:178:24)
at async instantiateModule (file:///D:/Qsync/workspace/guanwang/nuxt-app/.nuxt/dist/server/server.mjs:2717:3)
Remarks (补充说明)
类似:productdevbook/oku-nuxt3-template#1
The text was updated successfully, but these errors were encountered: