ant-design-vue icon indicating copy to clipboard operation
ant-design-vue copied to clipboard

编译源码报错

Open hdygxsj opened this issue 1 year ago • 3 comments
trafficstars

  • [X] I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.2.3

Environment

node 16 && mac m3

Reproduction link

https://github.com/hdygxsj/ant-design-vue.git

Steps to reproduce

yarn install yarn run dev 或者yarn run site

或者 npm install npm run dev 或者npm run site

What is expected?

源码编译成功

What is actually happening?

✅ Token Meta has been written to components/version/token-meta.json $ npm run routes && vite serve site

[email protected] routes node site/scripts/genrateRoutes.js

failed to load config from /Users/zhongyangyang/IdeaProjects/ant-design-vue/site/vite.config.ts error when starting dev server: TypeError: import_lru_cache.default is not a constructor at Object. (/Users/zhongyangyang/IdeaProjects/ant-design-vue/site/vite.config.ts:515:13) at Module._compile (node:internal/modules/cjs/loader:1198:14) at Object._require.extensions. [as .js] (file:///Users/zhongyangyang/IdeaProjects/ant-design-vue/node_modules/vite/dist/node/chunks/dep-372dab03.js:63162:24) at Module.load (node:internal/modules/cjs/loader:1076:32) at Function.Module._load (node:internal/modules/cjs/loader:911:12) at Module.require (node:internal/modules/cjs/loader:1100:19) at require (node:internal/modules/cjs/helpers:119:18) at loadConfigFromBundledFile (file:///Users/zhongyangyang/IdeaProjects/ant-design-vue/node_modules/vite/dist/node/chunks/dep-372dab03.js:63170:21) at loadConfigFromFile (file:///Users/zhongyangyang/IdeaProjects/ant-design-vue/node_modules/vite/dist/node/chunks/dep-372dab03.js:63028:34) at processTicksAndRejections (node:internal/process/task_queues:96:5) error Command failed with exit code 1.

hdygxsj avatar Jun 20 '24 01:06 hdygxsj

用window可以编译,编译后dist放到nginx下打开白屏 482bd61a80e47a05f08fbafb9334b078

nginx配置

    server {
        listen       8080;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            try_files $uri $uri/ /index.html;
            index  index.html index.htm;
        }


hdygxsj avatar Jun 21 '24 02:06 hdygxsj

npm install -f 或者 npm install --force,然后再执行npm run dev

selicens avatar Jun 21 '24 05:06 selicens

用window可以编译,编译后dist放到nginx下打开白屏 482bd61a80e47a05f08fbafb9334b078

nginx配置

    server {
        listen       8080;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            try_files $uri $uri/ /index.html;
            index  index.html index.htm;
        }
image 这改成./可以解决li'xian离线部署时渲染白屏的问题

hdygxsj avatar Jun 21 '24 06:06 hdygxsj