NativeScript / nativescript-dev-webpack

A package to help with webpacking NativeScript apps.
Apache License 2.0
97 stars 49 forks source link

ERROR: VueRouter is not a constructor #872

Open zbranzov opened 5 years ago

zbranzov commented 5 years ago

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

Describe the bug Trying to builds the app in 'samples' folder of https://github.com/nativescript-vue/nativescript-vue/tree/867e5f8f7f7433cb10d5445946c16a3b15161a49 using bundle flag cause the error above.

Expected behavior Be able to build the app

Sample project https://github.com/nativescript-vue/nativescript-vue/tree/867e5f8f7f7433cb10d5445946c16a3b15161a49/samples

Additional context Adding mainFields: ['main', 'module'] to the webpack.config seems to fix it but in that case we should commit the file

endarova commented 5 years ago

Hi @zbranzov, I managed to reproduce the described error with the sample app but I think the issue is with vue-router itself. There are issues logged in the vue-router repo which described the same problem and couple of workarounds. In my app I imported the VueRouter that way: import VueRouter from 'vue-router' or const VueRouter = require('vue-router').default and I was able to build and deploy the app. Can you please try if that will fix the issues on your side too.