Coder Social home page Coder Social logo

Comments (8)

ElMassimo avatar ElMassimo commented on May 22, 2024 1

Probably related to the latest version of Vite, which is a bit of a moving target:

(!) "build.base" config option is deprecated. "base" is now a root-level config option.
(!) "base" config option should start and end with "/".

I will release another version tomorrow targeting beta.44, moving build.base to base.

For now, try using vite: "2.0.0-beta.34".

from vite_ruby.

arcreative avatar arcreative commented on May 22, 2024 1

Seems like it might be working better... but I have to rewrite a lot of stuff to find out :-)

Thanks for the quick response, will let you know what I find out when I can dig into it a bit more.

from vite_ruby.

arcreative avatar arcreative commented on May 22, 2024 1

Thanks again for the prompt response! I wasn't aware of that import syntax--but it doesn't seem to work either. I'm also a bit concerned that it's not going to work for the vite build version of the app as well, since there isn't actually an export on default. I am using vite-plugin-vue2, since vite allegedly won't work without it, but this all seems like a bit too much going on to investigate at this point. Perhaps when vuetify goes to Vue 3 I can use Vue 3, then maybe this will all work out. Thank you for your time!

from vite_ruby.

ElMassimo avatar ElMassimo commented on May 22, 2024

Hey, thanks for reporting.

That null there suggests that there might be a missing configuration option.

Would you share your config/vite.json? Also, please run bin/rake vite:info and paste the result so that I can verify that you are not using a previous version.

The example app is also running 6.1.1, so it might be related to config.

from vite_ruby.

ElMassimo avatar ElMassimo commented on May 22, 2024

@arcreative Just released an update of vite_rails (1.0.11) and vite-plugin-ruby (1.0.5).

Please try using it with the latest vite (2.0.0-beta46), and let me know how it goes.

from vite_ruby.

arcreative avatar arcreative commented on May 22, 2024

@ElMassimo Any idea why I would be getting Vue.use is not a function when doing a standard import Vue from 'vue' and then trying to initiate a module? The import looks like the following (an object with default property that corresponds to what Vue should be):

Screen Shot 2021-01-25 at 10 33 33 AM

from vite_ruby.

ElMassimo avatar ElMassimo commented on May 22, 2024

Hard to know without more context, but from what I see in the screenshot, it seems the object is an ES module (instead of the export).

Try doing the following:

import { default as Vue } from 'vue'

or

Vue.default.use(...)

If it works, then it means the module is not unwrapping as expected. Not sure what could cause that to happen (could be related to any Vite plugins you are using, in which case upgrading to their latest versions might be worth a try).

I have a working example with Vue here, but it's not using the default export from Vue.


If you switched to Vue 3, it might be that the API for use has changed.

If using Vue 2, it might be necessary to use a specific Vite plugin.

from vite_ruby.

ElMassimo avatar ElMassimo commented on May 22, 2024

Have an example running Vite with Vue 2, you can find the details in this pull request.

from vite_ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.