maglevhq / maglev-core

Ruby on Rails website builder
https://www.maglev.dev
MIT License
273 stars 47 forks source link

Issue with Vite arising in Avo integration directions #53

Closed brandondrew closed 1 year ago

brandondrew commented 1 year ago

Following the directions at https://docs.maglev.dev/integrations/avo, I ran into a an error when I got to bin/rails g maglev:install

/Users/brandon/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/vite_ruby-3.3.2/lib/vite_ruby/compatibility_check.rb:24:in `raise_unless_satisfied': vite-plugin-ruby@^3.1.2 might not be compatible with vite_ruby-3.3.2 (ArgumentError)

You may disable this check if needed: https://vite-ruby.netlify.app/config/#skipcompatibilitycheck

You may upgrade both by running:

    bundle exec vite upgrade

        raise ArgumentError, <<~ERROR
              ^^^^^^^^^^^^^^^^^^^^^^^

Running bundle exec vite upgrade did not solve anything. Even using the environment variable suggested on the Rails Vite page didn't resolve anything:

VITE_RUBY_SKIP_COMPATIBILITY_CHECK=1 bin/rails s

bin/vite upgrade (also suggested by Vite-Ruby's documentation) didn't do anything because vite doesn't exist in bin. The error remained, and appeared any time I tried to run a command:

ArgumentError: vite-plugin-ruby@^3.1.2 might not be compatible with vite_ruby-3.3.2

I've never used Vite before, so I have no insight into what may be going wrong, and I'm not able to find any clues by Googling.

brandondrew commented 1 year ago

I tried specifying the vite_ruby gem to be 3.1.2, and later the vite_rails gem to be 3.1.2, hoping that might correspond to vite-plugin-ruby@3.1.2, but it didn't help.

brandondrew commented 1 year ago

The same thing happens immediately with this

rails new my-awesome-site \
  -m https://raw.githubusercontent.com/maglevhq/maglev-core/master/template.rb \
  --database=postgresql \
  --skip-action-cable
brandondrew commented 1 year ago

Or simply

rails new my-awesome-site \
  -m https://raw.githubusercontent.com/maglevhq/maglev-core/master/template.rb
BeatyThomas commented 1 year ago

getting this same error trying to do a new install with this:

rails new my-awesome-site \ -m https://raw.githubusercontent.com/maglevhq/maglev-core/master/template.rb \ --database=postgresql \ --skip-action-cable

I can get the rails server to run with VITE_RUBY_SKIP_COMPATIBILITY_CHECK=true but that seems to introduce a bunch of other problems.

jamgar commented 1 year ago

Get the same using both the Short and Long commands listed in the instructions.

brandondrew commented 1 year ago

@did Do you have any insight into the problem we're having?

did commented 1 year ago

hey all πŸ‘‹ I'll take a look at it this evening.

did commented 1 year ago

πŸ‘‹ @brandondrew.

I did 2 things:

I haven't had the time to re-play the Avo guide. I'll do it later today.

work-leonid commented 1 year ago
image

I no longer have the vite error, but a new one appears when I go to http://localhost:3000/maglev/admin/theme. http://localhost:3000 works without problems

jamgar commented 1 year ago

@did It is working for me now. Thank you for looking into this, it looks great!

@work-leonid I didn't have an issue going to http://localhost:3000/maglev/admin/theme

did commented 1 year ago

I'm closing this one. Don't hesitate to re-open it if the exact same issue arises again. Thanks!