crater icon indicating copy to clipboard operation
crater copied to clipboard

npm run buld, vite build

Open gr8ref opened this issue 2 years ago • 2 comments

It can not build

npm run build

> build
> vite build

Could not read configuration from PHP.
SyntaxError: Unexpected token W in JSON at position 1
    at JSON.parse (<anonymous>)
    at getConfigurationFromArtisan (C:\laragon\www\crater\node_modules\laravel-vite\dist\index.js:113:17)
    at defineConfig (C:\laragon\www\crater\node_modules\laravel-vite\dist\index.js:123:19)
    at Object.<anonymous> (C:\laragon\www\crater\node_modules\laravel-vite\dist\index.js:126:19)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Module._load (node:internal/modules/cjs/loader:827:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
Could not read configuration from PHP.
SyntaxError: Unexpected token W in JSON at position 1
    at JSON.parse (<anonymous>)
    at getConfigurationFromArtisan (C:\laragon\www\crater\node_modules\laravel-vite\dist\index.js:113:17)
    at defineConfig (C:\laragon\www\crater\node_modules\laravel-vite\dist\index.js:123:19)
    at Object.<anonymous> (C:\laragon\www\crater\vite.config.ts:30:64)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at require.extensions.<computed> [as .ts] (C:\laragon\www\crater\node_modules\vite\dist\node\chunks\dep-27bc1ab8.js:61679:20)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Module._load (node:internal/modules/cjs/loader:827:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
vite v2.9.5 building for production...
✓ 0 modules transformed.
You must supply options.input to rollup
error during build:
Error: You must supply options.input to rollup
    at Graph.generateModuleGraph (C:\laragon\www\crater\node_modules\rollup\dist\shared\rollup.js:23004:19)
    at async Graph.build (C:\laragon\www\crater\node_modules\rollup\dist\shared\rollup.js:22947:9)
    at async C:\laragon\www\crater\node_modules\rollup\dist\shared\rollup.js:23612:13
    at async catchUnfinishedHookActions (C:\laragon\www\crater\node_modules\rollup\dist\shared\rollup.js:23121:20)
    at async rollupInternal (C:\laragon\www\crater\node_modules\rollup\dist\shared\rollup.js:23609:5)
    at async doBuild (C:\laragon\www\crater\node_modules\vite\dist\node\chunks\dep-27bc1ab8.js:39169:24)
    at async build (C:\laragon\www\crater\node_modules\vite\dist\node\chunks\dep-27bc1ab8.js:39011:16)
    at async CAC.<anonymous> (C:\laragon\www\crater\node_modules\vite\dist\node\cli.js:738:9)

Please complete the following information:

  • Crater version: latest
  • PHP version: 7.4
  • Database type and version: mysql

Optional info

  • OS: Windows, localhost
  • Browser: any

gr8ref avatar Apr 25 '22 16:04 gr8ref

Hello, I have the same problem. Did you find a way to make it work ? Thanks

update: My problem was i misconfiguration issue on PHP. I had to focus on php warning

amysticool avatar May 18 '22 15:05 amysticool

Try running php artisan vite:config in my case, I got Warning: Module 'openssl' already loaded in line 0, and simply add comment to php.ini at line ;extension=php_openssl.dll

Ticlext-Altihaf avatar Aug 01 '23 07:08 Ticlext-Altihaf