vconsole-webpack-plugin
vconsole-webpack-plugin copied to clipboard
Next.js中集成失败,无法启动无法打包
https://codesandbox.io/s/ecstatic-nightingale-1sl2ty
https://codesandbox.io/s/ecstatic-nightingale-1sl2ty
补充信息:
sandbox@sse-sandbox-fg0924:/sandbox$ npm run build
> [email protected] build /sandbox
> next build
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
info - Creating an optimized production build
info - Compiled successfully
> Build error occurred
ReferenceError: XMLHttpRequest is not defined
at /sandbox/node_modules/vconsole/dist/vconsole.min.js:10:185337
at /sandbox/node_modules/vconsole/dist/vconsole.min.js:10:248218
at /sandbox/node_modules/vconsole/dist/vconsole.min.js:10:248289
at /sandbox/node_modules/vconsole/dist/vconsole.min.js:10:81
at Object.<anonymous> (/sandbox/node_modules/vconsole/dist/vconsole.min.js:10:208)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.KGLt (/sandbox/.next/server/pages/_app.js:233:18)
at __webpack_require__ (/sandbox/.next/server/pages/_app.js:23:31)
at Object.l8iu (/sandbox/.next/server/pages/_app.js:267:16)
at __webpack_require__ (/sandbox/.next/server/pages/_app.js:23:31)
at Object.3 (/sandbox/.next/server/pages/_app.js:99:1)
info - Collecting page data .npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/sandbox/.npm/_logs/2022-06-17T08_14_41_315Z-debug.log
sandbox@sse-sandbox-fg0924:/sandbox$
经测试,v1.6.1有效,1.7.x无效
嗯,好像是 vConsole 那边的问题,我有空也测试看看
https://github.com/Tencent/vConsole/issues/588