Skip to content

Libraries compiled with 3.0.8 may be incompatible with 3.0.7 #3493

Closed
@relief-melone

Description

@relief-melone

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

  • vue create (with default settings)
  • install my library using npm
  • add the use to main.ts

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔥 p5-urgentPriority 5: this fixes build-breaking bugs that affect most users and should be released ASAP.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions