vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.51k stars 4.76k forks source link

引入了ali-oss库, 开发时正常 打包就报错 #2987

Open chinaliyun opened 2 years ago

chinaliyun commented 2 years ago

Bug report

Steps to reproduce

公司内部的UI组件库中引入了 ali-oss包(经过排查, 确定是因为引入了这个包导致打包失败了), 开发时运行正常, 打包的时候就报错了

What is expected?

What is actually happening?

wait Extracting site metadata...
tip Apply theme @vuepress/theme-default ...
warning An error was encountered in plugin "@vuepress/plugin-back-to-top"
warning An error was encountered in plugin "@vuepress/plugin-medium-zoom"
tip Apply plugin container (i.e. "vuepress-plugin-container") ...
tip Apply plugin @vuepress/register-components (i.e. "@vuepress/plugin-register-components") ...
tip Apply plugin @vuepress/active-header-links (i.e. "@vuepress/plugin-active-header-links") ...
tip Apply plugin @vuepress/search (i.e. "@vuepress/plugin-search") ...
tip Apply plugin @vuepress/nprogress (i.e. "@vuepress/plugin-nprogress") ...

✔ Client
  Compiled successfully in 22.44s

✔ Server
  Compiled successfully in 14.21s

wait Rendering static HTML...
error Error rendering /components/scene.html: false
undefined
error Error rendering /components/preview.html: false
undefined
error Error rendering /guide/npm-source.html: false
undefined
error Error rendering /: false
undefined
error Error rendering /guide/install.html: false
undefined
error Error rendering /guide/color-variable.html: false
undefined
error Error rendering /options/: false
undefined
error Error rendering /404.html: false
undefined
server-bundle.js:100745
    __webpack_require__(522),
                        ^^^

SyntaxError: Unexpected number
    at new Script (vm.js:102:7)
    at getCompiledScript (/Users/liyun/Office/www/admall/web/admall-ui-docs/node_modules/vue-server-renderer/build.dev.js:9318:18)
    at evaluateModule (/Users/liyun/Office/www/admall/web/admall-ui-docs/node_modules/vue-server-renderer/build.dev.js:9333:18)
    at /Users/liyun/Office/www/admall/web/admall-ui-docs/node_modules/vue-server-renderer/build.dev.js:9409:18
    at new Promise (<anonymous>)
    at /Users/liyun/Office/www/admall/web/admall-ui-docs/node_modules/vue-server-renderer/build.dev.js:9401:14
    at Object.renderToString (/Users/liyun/Office/www/admall/web/admall-ui-docs/node_modules/vue-server-renderer/build.dev.js:9577:9)
    at Build.renderPage (/Users/liyun/Office/www/admall/web/admall-ui-docs/node_modules/@vuepress/core/lib/node/build/index.js:150:34)
    at /Users/liyun/Office/www/admall/web/admall-ui-docs/node_modules/@vuepress/core/lib/node/build/index.js:95:43
    at Array.map (<anonymous>)
    at Build.render (/Users/liyun/Office/www/admall/web/admall-ui-docs/node_modules/@vuepress/core/lib/node/build/index.js:95:26)
    at async App.build (/Users/liyun/Office/www/admall/web/admall-ui-docs/node_modules/@vuepress/core/lib/node/App.js:499:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Other relevant information

GregoireF commented 2 years ago

Hi @chinaliyun,

First of all, thanks for your interest in VuePress 1.X :heart:

Would it be possible to provide a sample repo with the error so that I can help you in your resolution of your incident?

Have a nice day/evening,

Cheers.