vue-form-2 icon indicating copy to clipboard operation
vue-form-2 copied to clipboard

Uncaught TypeError: Vue is not a constructor

Open jrutley opened this issue 8 years ago • 4 comments

I'm getting "Uncaught TypeError: Vue is not a constructor" after running the official cli

$ vue init webpack my-project
...
$ npm install vue-form-2 --save
$ npm run dev

and by adding import { VueForm, Event } from 'vue-form-2' to main.js

node version is 7.3.0 npm version is 3.10.10

The failure is happening on bus.js on the line below: var bus = new Vue();

Suggestions?

jrutley avatar Mar 31 '17 19:03 jrutley

Changing bus.js to the new import style "fixes" it, but I'm sure that doing that will cause other problems.

import Vue from 'vue'
var bus = new Vue();

export default bus;

jrutley avatar Mar 31 '17 19:03 jrutley

This worked for me, not sure if it's actually any different than above.

import Vue from 'vue/dist/vue.common.js';

someburner avatar Aug 06 '17 00:08 someburner

I'm having the same issue. Applying the manual edit of @jrutley fixes it for me too, but manually editing files in node_modules does not seem viable.

johanburatti avatar Oct 28 '18 11:10 johanburatti

Fixed in #25 :-)

johanburatti avatar Oct 28 '18 11:10 johanburatti