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
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'importlaravelfrom'laravel-vite-plugin'importvuefrom'@vitejs/plugin-vue2'exportdefaultdefineConfig({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)
I'm running Laravel ^9.19 on Homestead with PHP 8.1
I'm running npm 8.15 from Node 16 on Windows 10 to compile assets with Vite
The text was updated successfully, but these errors were encountered:
aroy314
changed the title
Could not load module
[PLUGIN_ERROR] Could not load module : The argument 'path' must be a string or Uint8Array without null bytes
Jul 28, 2022
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 :
The text was updated successfully, but these errors were encountered: