antfu-collective / vite-ssg

Static site generation for Vue 3 on Vite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build error when import ant-design-vue

bobby169 opened this issue · comments

commented

Describe the bug

I use the vitesse template to test vite-ssg.

add ant-design-vue and run scripts npm run dev no error, but error when run npm run build .

import { Button } from "ant-design-vue/es/index.js";
         ^^^^^^
SyntaxError: Named export 'Button' not found. The requested module 'ant-design-vue/es/index.js' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'ant-design-vue/es/index.js';

Reproduction

https://github.com/bobby169/vitesse

System Info

System:
    OS: macOS 12.6.2
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 124.25 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.14.2 - /usr/local/bin/node
    npm: 9.5.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 114.0.5735.133
    Safari: 15.6.1

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

I use NaiveUI and have the same problem as you, what can i do? so sad !

same error.

nuxt build no problem. but nuxt can't use keepalive with include.

nuxt add <RouteProvider> as <Keepalive> 's children in each page, so can't use page name to diff them.

nuxt/nuxt#15214

same error.