Closed makroxyz closed 1 year ago
I solved by myself... need to remove
define: {
global: 'window', // fix for packages that support both node and browser
},
from vite.config.js
please close.
im facing the same problem here, but this solution didnt work for me.
exactly same error:
Could not resolve './node_modules/.pnpm/core-js@3.21.1/node_modules/core-js/internals/window.js' from node_modules/gmap-vue/dist/esm/main.js
error during build:
Error: Could not resolve './node_modules/.pnpm/core-js@3.21.1/node_modules/core-js/internals/window.js' from node_modules/gmap-vue/dist/esm/main.js
at error (file:///home/mateus/workspace/dashboard-frontend/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
at ModuleLoader.handleResolveId (file:///home/mateus/workspace/dashboard-frontend/node_modules/rollup/dist/es/shared/rollup.js:22332:24)
at file:///home/mateus/workspace/dashboard-frontend/node_modules/rollup/dist/es/shared/rollup.js:22295:26
My vite.config.js
:
import path from 'path';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue2';
import WindiCSS from 'vite-plugin-windicss';
import postcss from './postcss.config';
const config = defineConfig({
resolve: {
alias: {
path: 'path-browserify',
'@': `${path.resolve(__dirname, 'src')}`
}
},
define: {
global: 'window'
},
build: {
minify: true
},
plugins: [vue(), WindiCSS()],
css: {
postcss
},
server: {
port: 8080
}
});
export default config;
This should be fixed with the removal of core-js in #273.
@mateusmcordeiro, was your issue fixed with the last release?
Migrate to the new version of the plugin for Vue v3
Describe the bug
running
npm run build
on vite givesCould not resolve './node_modules/.pnpm/core-js@3.21.1/node_modules/core-js/internals/window.js' from node_modules/gmap-vue/dist/esm/main.js error during build: Error: Could not resolve './node_modules/.pnpm/core-js@3.21.1/node_modules/core-js/internals/window.js' from node_modules/gmap-vue/dist/esm/main.js at error (/home/vagrant/code/node_modules/rollup/dist/shared/rollup.js:198:30) at ModuleLoader.handleResolveId (/home/vagrant/code/node_modules/rollup/dist/shared/rollup.js:22508:24) at /home/vagrant/code/node_modules/rollup/dist/shared/rollup.js:22471:26
To reproduce
simply run
npm run build
Expected behavior
Should compile w/o errors
Current behavior
The error above stops compile
Screenshots
Desktop (please complete the following information)
Smartphone (please complete the following information)
Additional context
This is the only package that fails
Versions
Package manager
Plugin version
Any ideas?