-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Libraries compiled with 3.0.8 may be incompatible with 3.0.7 #3493
Comments
You should rebuild your project( |
@HcySunYang Then this is a breaking change introduced in a patch release. That's not really what we want to do unless absolutely necessary in terms of bug fixing, I would say. We should discuss this in the team, re-evaluate the real impact of this on lib maintainers and come up with a strategy to handle this situation. |
This is a necessary refactoring for slot scope id, see #3374, yes, this is a breaking change for library authors. I just realized that the build resources of So I think it must be that the version of the vue compiler used by the library author is lower than 3.0.8 |
Still, if it's breaking a ton of libs, we should consider rolling this back, communicating the change with the community and give them time to prepare. Because at the end, it's not only affecting lib authors, it would break many apps that use a lib that was compiled with a compiler version |
I agree, but this is actually a problem that must occur during dev or build process. Users should be easy to detect and it does not seem to bring hidden risks to users. |
Thanks for the quick reply. That was indeed the problem. Since in my test project (where I am actually importing the source from my library) I was adding vue from cdn but using the compiler version 3.0.7 this did not work. And importing the built version did not work as it was compiled using an older version. Now I am just caught up a little. I have to use rollup to bundle this lib even tough I would happily use vite because I have to use it in projects that are dependent on vue2 and cannot be updatet to vue3 just jet because of dependency issues. And while vite is not as far as I know able to build Vue2 Apps the current rollup vue plugin (I guess this is the one compiling vue for rollup?) does not implement the new compiler yet. (beta 10 depends on 3.0.0-rc.5) This should not be your concern and does not affect this issue but it may affect others that try to maintain component libraries using the power of vue3 but still beeing able to make those libraries work in vue2. Anyway thanks for the quick reply again. Always amazed how active this community is even on a saturday ;) |
Yes, people upgrading to 3.0.8 will likely find this bug during build, and can then roll back to 3.0.7. Still, this is problematic. Disclaimer We still need to figure out how broad the effect of the issue is. @relief-melone this is not really an issue for vite itself. you can upgrade the compiler in a vite project as well, it's not hardcoded to 3.0.7 or anything. I'll also reopen this issue as for us, it's not resolved. |
Would be a better strategy. Also gives us to to rethink how to introduce the change while creating as little friction as possible. |
https://github.com/vuejs/rollup-plugin-vue/blob/next/package.json#L26 you just have to make sure that the compiler installed in the project is for 3.0.8. But before doing that maybe wait a bit until we can communicate clearly how we proceed with this issue.
Vue 2 isn't affected by this at all as the compiler change only affects Vue 3 projects. |
OK updating the compiler manually to 3.0.8 also seems to work for the rollup plugin (probably just forgot to npm serve again the first time). The only thing that I noticed is that backward compatiblity would also be an issue. So if I compile my library with 3.0.8 but leave my test environment on 3.0.7 this will also result in the same error |
I can confirm that with 3.0.9 everything is working again as expected. Thanks alot |
Version
3.0.8
Reproduction link
https://gitlab.com/rm-issues/v3.0.8-using-plugin-fails
Steps to reproduce
Clone the repository.
Run npm serve
Open localhost:8080
Check dev console
What is expected?
The Home view from the basic setup should be displayed correctly when using an external library.
What is actually happening?
If you use version 3.08. vue cannot be loaded in the external library. Instead when trying to import anything from vue in App.vue you will be getting the error
Uncaught TypeError: Object(...) is not a function
I am the creator of vue-mapbox-ts and up until this morning everything worked out well. But this morning it stopped to work. After some digging I found that for my test page I was still using an cdn import and vue had been updated to version 3.0.8. 3.0.7 was (and is) running just fine.
I tried to boil down the problem to the minimal changes based on a default vue application created by @vue/cli and this is what I did
I did not use any components from that library and left the App.vue as it was so there are no more changes to the basic installation. However the error
Uncaught TypeError: Object(...) is not a function
will be thrown in App.vue when trying to import defineComponent (or anything else for that matter) from "vue"
Now usually this happens if I mess up something with my externals when I am testing component libraries and multiple instances of vue are present but this is not the case here. The plugin just registers some components. Everything is still working fine with 3.0.7.
Now I am still getting into some of the details of creating component libraries in vue3 and my implementation might not be perfect. However I think that with just new patch release 3.0.7 -> 3.0.8 vue should behave in the same manner.
Just for testing I also tried importing vue from a cdn and defining the externals in my webpack config to rule out this reason but the outcome is the same
The text was updated successfully, but these errors were encountered: