Closed Djaangoo closed 3 weeks ago
update v1.4.2
error still there.
The requested module 'apps/web/node_modules/.pnpm/dayjs@1.11.11/node_modules/dayjs/plugin/advancedFormat.js?v=ee90e717' does not provide an export named 'default'
pnpm 9.4.0 "nuxt": "^3.12.2", "@ant-design-vue/nuxt": "^1.4.2"
The commit make sense and the playground plays well but not on my new repo.
I learnt to write my own vite plugins:
// https://nuxt.com/docs/api/configuration/nuxt-config
function resolveAntdv() {
return {
name: "resolveAntdv",
config: () => ({
resolve: {
alias: [
{
find: /^dayjs\/plugin\/(.*)$/,
replacement: "dayjs/esm/plugin/$1",
},
],
},
}),
};
}
export default defineNuxtConfig({
devtools: { enabled: true },
srcDir: "src",
modules: ["@ant-design-vue/nuxt"],
vite: {
plugins: [resolveAntdv()],
},
});
After that the issue resolved. Wonder if I missing some configurations.
The error occurs in the snippet
// node_modules/.pnpm/ant-design-vue@4.2.3_vue@3.4.29/node_modules/ant-design-vue/es/vc-picker/generate/dayjs.js
import advancedFormat from 'dayjs/plugin/advancedFormat';
the import path seems transpiled to
import advancedFormat from "node_modules/.pnpm/dayjs@1.11.11/node_modules/dayjs/plugin/advancedFormat.js?v=bf306f25";
Can you submit a reproduction?
The error occurs in the snippet
// node_modules/.pnpm/ant-design-vue@4.2.3_vue@3.4.29/node_modules/ant-design-vue/es/vc-picker/generate/dayjs.js import advancedFormat from 'dayjs/plugin/advancedFormat';
the import path seems transpiled to
import advancedFormat from "node_modules/.pnpm/dayjs@1.11.11/node_modules/dayjs/plugin/advancedFormat.js?v=bf306f25";
package.json
{ "name": "nuxt-app", "private": true, "type": "module", "scripts": { "build": "nuxt build", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare" }, "dependencies": { "nuxt": "^3.11.2", "vue": "^3.4.27", "vue-router": "^4.3.2" }, "devDependencies": { "@ant-design-vue/nuxt": "^1.4.1" } }
nuxt.condig.ts
// https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ devtools: { enabled: true }, modules: [ '@ant-design-vue/nuxt' ], })
result: App stop working and in devtools i have error:
Problem is only on PNPM