Skip to content

TypeError: Vue is not a constructor #5470

Closed
@adyz

Description

@adyz

Version

2.2.6

Reproduction link

https://jsbin.com/domunix/edit?html,js,output

Steps to reproduce

I was using Vue 2.1.8 with webpack2 and loading vue in my backbone router with require.ensure function provided by webpack for code splitting.

require.ensure([], function(){
            window.Vue = require('vue');
});

This allowed be to load Vue library only for the routes I needed, but since I've updated to 2.2.6 I get TypeError: Vue is not a constructor in the browser.

What is expected?

To build as before

What is actually happening?

TypeError: Vue is not a constructor


Using import Vue from 'vue' will not help since I want the Vue library to be loaded on demand. Is there any ways to achieve this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions