You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used a npm package that uses babel, and the product contains polyfill code provided by core-js. When I run vite build, I get an error, which is confusing. Can someone provide some help
error during build:
[vite]: Rollup failed to resolve import "core-js/modules/es.array.iterator.js" from "/Users/xx/Documents/workspace/huoyun/my-vue-app/node_modules/.pnpm/[email protected]/node_modules/xx/dist/kop.mjs".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
at viteWarn (file:///Users/xx/Documents/workspace/huoyun/my-vue-app/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:65511:17)
at onRollupWarning (file:///Users/xx/Documents/workspace/huoyun/my-vue-app/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:65543:5)
at onwarn (file:///Users/xx/Documents/workspace/huoyun/my-vue-app/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-BaOMuo4I.js:65206:7)
at file:///Users/xx/Documents/workspace/huoyun/my-vue-app/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:18646:13
at Object.logger [as onLog] (file:///Users/xx/Documents/workspace/huoyun/my-vue-app/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:20301:9)
at ModuleLoader.handleInvalidResolvedId (file:///Users/xx/Documents/workspace/huoyun/my-vue-app/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19236:26)
at file:///Users/xx/Documents/workspace/huoyun/my-vue-app/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19194:26
ELIFECYCLE Command failed with exit code 1.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I used a npm package that uses babel, and the product contains polyfill code provided by core-js. When I run vite build, I get an error, which is confusing. Can someone provide some help
Beta Was this translation helpful? Give feedback.
All reactions