import naive from 'naive-ui' build error: export { default, install } from './preset'; ^^^^^^ SyntaxError: Unexpected token 'export' #1399
Labels
bug: pending triage
Maybe a bug, waiting for confirmation
Describe the bug
update "vitepress": "^1.0.0-alpha.6"
in theme index.js
import naive from 'naive-ui'
enhanceApp({ app }) {
app.use(naive)
}
npm run docs:build
✓ building client + server bundles...
(node:31512) 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)build error:
C:\Users\A0\Documents\vitePress\node_modules\naive-ui\es\index.js:1
export { default, install } from './preset';
^^^^^^
SyntaxError: Unexpected token 'export'
at wrapSafe (node:internal/modules/cjs/loader:1032:15)
at Module._compile (node:internal/modules/cjs/loader:1067:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157: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:168:29)
at ModuleJob.run (node:internal/modules/esm/module_job:197:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:337:24)
Reproduction
npm run docs:build
Expected behavior
theme Full Import naive-ui
build success
System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: