Hi,
I'm trying to migrate from Laravel Mix to Vite, and I encouter an issue about vite-plugin-vue2.
When I'm running vite build, the CLI returns this error :
vite build
vite v3.0.3 building for production...
✓ 126 modules transformed.
[vite:vue2] Could not load C:/Dev/Code/production/siteref/node_modules/vue2-google-maps/dist/components/placeInputImpl.js?vue&type=script&src=true&lang.js?commonjs-exports (imported by node_modules/vue2-google-maps/dist/components/placeInputImpl.js?vue&type=script&src=true&lang.js): The ar
gument 'path' must be a string or Uint8Array without null bytes. Received '\x00C:/Dev/Code/production/siteref/node_modules/vue2-google-maps/dist/components/placeInputImpl.js'
error during build:
TypeError [PLUGIN_ERROR]: Could not load C:/Dev/Code/production/siteref/node_modules/vue2-google-maps/dist/components/placeInputImpl.js?vue&type=script&src=true&lang.js?commonjs-exports (imported by node_modules/vue2-google-maps/dist/components/placeInputImpl.js?vue&type=script&src=true&la
ng.js): The argument 'path' must be a string or Uint8Array without null bytes. Received '\x00C:/Dev/Code/production/siteref/node_modules/vue2-google-maps/dist/components/placeInputImpl.js'
at Object.openSync (node:fs:577:10)
at Object.readFileSync (node:fs:453:35)
at Object.load (C:\Dev\Code\production\siteref\node_modules\@vitejs\plugin-vue2\dist\index.cjs:3217:30)
at file:///C:/Dev/Code/production/siteref/node_modules/rollup/dist/es/shared/rollup.js:22695:37
It seems that it tries to load a file from a path, but the string of the path contains \x00 at the beginning, and it seems to make it fail.
What do you advice to fix that ? Should something be done to clean file paths from this kind of character ?
Here is my implementation of vite.config.js :
import {defineConfig} from 'vite'
import laravel from 'laravel-vite-plugin'
import vue from '@vitejs/plugin-vue2'
export default defineConfig({
clearScreen: false,
plugins: [
laravel({
input: [
'resources/assets/sass/vendor.scss',
'resources/assets/sass/app.scss',
'resources/assets/js/app.js'
],
buildDirectory: 'assets', // The public subdirectory where compiled assets should be written.
refresh: true // Configuration for performing full page refresh on blade (or other) file changes.
}
),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false
}
}
})
]
})
Here are my packages from package.json : (there might be some leftovers from laravel-mix)
Hello @aroy314. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.
Hi, I'm trying to migrate from Laravel Mix to Vite, and I encouter an issue about vite-plugin-vue2.
When I'm running
vite build
, the CLI returns this error :It seems that it tries to load a file from a path, but the string of the path contains
\x00
at the beginning, and it seems to make it fail. What do you advice to fix that ? Should something be done to clean file paths from this kind of character ?Here is my implementation of
vite.config.js
:Here are my packages from
package.json
: (there might be some leftovers from laravel-mix)Additionnal information :