Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove the vite clean rake task #93

Merged
merged 4 commits into from
Nov 22, 2024
Merged

fix: remove the vite clean rake task #93

merged 4 commits into from
Nov 22, 2024

Conversation

did
Copy link
Contributor

@did did commented Nov 12, 2024

fix issue #91

@malakada
Copy link

Working on testing this locally but running into an issue that only happens when I install this version of the gem, so I suspect that it's related.

After finding the error, I tried following the recommended fix step for Vite but it didn't go well. Below are the steps and results that I tried:

Error from localhost:3000/maglev/editor:

Showing ~/.gem/ruby/3.3.0/bundler/gems/maglev-core-b911a675285a/app/views/maglev/editor/show.html.erb where line #17 raised:

Vite Ruby can't find images/logo.png in the manifests.

Possible causes:
  - The last build failed. Try running `bin/vite build --clear --mode=development` manually and check for errors.

Running the recommended command resulted in:

vite build --clear --mode=development
Check that your vite.json configuration file is available in the load path:

	No such file or directory @ rb_sysopen - /Users/malak/development/society-three-phx/config/vite.json

Removed vite cache and output dirs:
	/Users/malak/development/society-three-phx/public/vite
	/Users/malak/development/society-three-phx/public/vite-ssr
	/Users/malak/development/society-three-phx/tmp/cache/vite
	/Users/malak/development/society-three-phx/node_modules/.vite
Building with Vite ⚡️
vite v5.4.11 building for development...
✓ 0 modules transformed.
(node:9833) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
x Build failed in 5ms
error during build:
Could not resolve entry module "index.html".
    at getRollupError (file:///Users/malak/.npm/_npx/9ed06546b0653f96/node_modules/rollup/dist/es/shared/parseAst.js:396:41)
    at error (file:///Users/malak/.npm/_npx/9ed06546b0653f96/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at ModuleLoader.loadEntryModule (file:///Users/malak/.npm/_npx/9ed06546b0653f96/node_modules/rollup/dist/es/shared/node-entry.js:20104:20)
    at async Promise.all (index 0)

pid 9833 exit 1
Build with Vite failed! ❌

After that, I remembered that there was a maglev:vite:build command so I gave it a try. It seemed to imply I needed to do an npm i, which I did, yet I still had the same result with a second maglev:vite:build... the three steps are included together here:

 ✘  ~/development/society-three-phx   main ±  rails maglev:vite:build
Building with Vite ⚡️
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] [--require #0] <scriptName> ...

pid 10066 exit 1
Build with Vite failed! ❌
 ✘  ~/development/society-three-phx   main ±  npm i
(node:10107) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

up to date, audited 19 packages in 382ms

6 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
 ~/development/society-three-phx   main ±  rails maglev:vite:build
Building with Vite ⚡️
Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] [--require #0] <scriptName> ...

pid 10148 exit 1
Build with Vite failed! ❌

I'm not very familiar with Vite at all, so I'm not sure how these may or may not be related to the change you made. If there's any extra logging or output that would be helpful please let me know. :D Thanks again for getting this out so quickly!

@did did added the bug Something isn't working label Nov 22, 2024
@did
Copy link
Contributor Author

did commented Nov 22, 2024

@did did merged commit cbb74a1 into master Nov 22, 2024
4 checks passed
@did did deleted the fix-issue-91 branch November 22, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants