Skip to content

I use vue3 with vite, got this error message : external_commonjs_vue_commonjs2_vue_root_Vue_default.a is not a constructor #475

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

Closed
jok311 opened this issue Oct 2, 2020 · 13 comments

Comments

@jok311
Copy link

jok311 commented Oct 2, 2020

I use vue3 with vite, got this error message below:

vue-grid-layout.js:1630 Uncaught (in promise) TypeError: external_commonjs_vue_commonjs2_vue_root_Vue_default.a is not a constructor
at Proxy.created (vue-grid-layout.js:1630)

@gmsa gmsa closed this as completed Oct 6, 2020
@jasonandjay
Copy link

why close this problem?how to resolve it? @gmsa

@SergeyKhval
Copy link
Contributor

@jasonandjay @jok311 take a look at vue3 branch https://github.com/jbaysolutions/vue-grid-layout/tree/vue3

@betterRunner
Copy link

The issue is still there, have tried https://github.com/jbaysolutions/vue-grid-layout/tree/vue3 but getting the same error, any updates?

@SergeyKhval
Copy link
Contributor

SergeyKhval commented Nov 5, 2020

Sorry, my bad. The code is actually in this PR #470. Haven't noticed that it hadn't been merged into vue3 branch

@SergeyKhval
Copy link
Contributor

@gmsa may be we can merge this PR so it will be a starting point for Vue 3 related work?

@betterRunner
Copy link

betterRunner commented Nov 5, 2020

@SergeyKhval Hi, thanks for the fast reply. I actually also tested the code in #470 by replacing the dist code to my node_modules/vue-grid-layout but still getting the same error. Then I cloned the code and try to build it locally but getting [!] (plugin commonjs) SyntaxError: Unexpected token (2:4) in E:\code\demo\vue-grid-layout\src\components\GridItem.vue?vue&type=template&id=15f3b9ae&lang.js src\components\GridItem.vue?vue&type=template&id=15f3b9ae&lang.js (2:4)

@SergeyKhval
Copy link
Contributor

What version of Node do you have? I think you'll need v12+ to run it in dev mode or build.
Just tried to run it in dev and build locally but everything seems fine.

@gmsa
Copy link
Contributor

gmsa commented Nov 5, 2020

Just merged the PR @SergeyKhval . Thank you for the work.

@rhlatky
Copy link

rhlatky commented Dec 26, 2020

Hello,
I have the same problem, even with the vue3 branch.

Vue version: 3.0.4
Node version: 14.15.3

When I clone and run the repository with the selected vue3 branch it works as expected.

In a moment when I try to use it from node modules, I'm getting external_commonjs_vue_commonjs2_vue_root_Vue_default.a is not a constructor error.

Also tried it with a new project with the same result.

@radoslavirha
Copy link

Hello, any update? Thanks

@jvjvjv
Copy link

jvjvjv commented Jan 24, 2023

Hello, any update? Thanks

I've seen this issue when I use the main release, but if I use the vue3 release, e.g.,

npm rm vue-grid-layout
npm add vue-grid-layout@next

I had no problem. Hopefully this helps for now. But be aware that this version for Vue3 is a little outdated, and I don't know what features or bugfixes are missing from the vue3 version.

@radoslavirha
Copy link

Hi, thanks, I installed vue3-grid-layout-next and it's working.

@Sandyzhao19
Copy link

Sandyzhao19 commented Mar 18, 2024

Hi, thanks, I installed vue3-grid-layout-next and it's working.

npm install vue3-grid-layout-next works for me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants