vueComponent / ant-design-vue-nuxt

MIT License
61 stars 6 forks source link

Nuxt with AntDV Throws Error: yarn and pnpm #57

Closed LireEruel closed 2 months ago

LireEruel commented 2 months ago

I followed the settings using the link below:

https://nuxt.com/modules/ant-design-vue

1. pnpm add -D @ant-design-vue/nuxt

image

2. Add @ant-design-vue/nuxt to the modules section of nuxt.config.ts

my nuxt.config.ts

export default defineNuxtConfig({
  modules: ["@ant-design-vue/nuxt"],
  devtools: { enabled: true },
});

3. App.vue

<script lang="ts" setup>
const handleMessage = () => {
  message.info("This is a normal message");
};
</script>
<template>
  <a-button @click="handleMessage"> button </a-button>
</template>

4. result

image

image image

Attempts to Resolve the Issue

  1. Reinstalling Dayjs
    • Not working
  2. Changed the Package Manager pnpm to npm
    • Worked!
    • yarn, pnpm is not working. only npm is working
LireEruel commented 2 months ago

After deleting the node_modules and reinstalling with npm, it worked properly. I am curious as to why this issue occurs. Since the Package management tools preferred by modern developers are yarn and pnpm rather than npm, I will keep the issue open.

aibayanyu20 commented 2 months ago

try npx nuxi@latest module add ant-design-vue

LireEruel commented 2 months ago

Thank you!!!