npm run build with AntDesignVueResolver [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/home/project/node_modules/ant-design-vue/es' is not supported resolving ES modules
See original GitHub issuei have tried to set cjs to both true and false to build, but same error. using all latest version.
Components({
// allow auto load markdown components under `./src/components/`
extensions: ['vue', 'md'],
// allow auto import and register components used in markdown
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
// custom resolvers
resolvers: [
// auto import icons
// https://github.com/antfu/unplugin-icons
IconsResolver({
componentPrefix: '',
// enabledCollections: ['carbon']
}),
// https://github.com/antfu/unplugin-vue-components/issues/202
AntDesignVueResolver({
cjs: false
}),
],
dts: 'src/components.d.ts',
}),
error:
[vite-ssg] An internal error occurred.
[vite-ssg] Please report an issue, if none already exists: https://github.com/antfu/vite-ssg/issues
(node:186362) UnhandledPromiseRejectionWarning: Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/home/project/node_modules/ant-design-vue/es' is not supported resolving ES modules imported from /home/project/.vite-ssg-temp/main.mjs
Did you mean to import ant-design-vue@3.0.0-beta.4_ae87cbba5ec93a01f3fe1197df446ca3/node_modules/ant-design-vue/es/index.js?
at new NodeError (internal/errors.js:322:7)
at finalizeResolution (internal/modules/esm/resolve.js:304:17)
at moduleResolve (internal/modules/esm/resolve.js:731:10)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:842:11)
at Loader.resolve (internal/modules/esm/loader.js:89:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)
at link (internal/modules/esm/module_job.js:75:36)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:186362) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 17)
(node:186362) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
npm run dev works fine, using template from https://github.com/antfu/vitesse
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:12
Top Results From Across the Web
'Directory import is not supported resolving ES modules' with ...
With ES6 modules you can not (yet?) import directories. Your import should look like this: import database from "./database/index.js".
Read more >@nextcloud/vue - npm
This repo contains the various Vue.js components that Nextcloud uses for its internal design and structure. It provides standardized UI elements for building...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same problem with primevue and vitesse
Vitesse also uses vite-ssg. Setting format to
cjs
in ssgOptions fixed my issue.vite.config.ts:
Also, I have updated all the packages.
I also have this problem
npm run dev works fine, using template from https://github.com/antfu/vitesse