chris-visser / meteor-vue-admin

A fully functional Meteor + Vue admin system with Meteor account integration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic import in router component don't work on Deployment!

thearabbit opened this issue · comments

I base on this project, and create the sample.
But dynamic import in router component don't work on Deployment!

{
    path: '/',
    name: 'Dashboard',
    component: () => import('./pages/Dashboard.vue'), // don't work
    meta: {
      title: 'Dashboard',
      icon: 'fas fa-tachometer-alt',
      noCache: true,
    },
  },

Get the error

19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:25 POST http://68.183.176.122/__meteor__/dynamic-import/fetch net::ERR_CONNECTION_REFUSED
i @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:25
(anonymous) @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:25
(anonymous) @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:1
Promise.then (async)
n.then @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:21
t.fetch @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:25
(anonymous) @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:7
(anonymous) @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:7
(anonymous) @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:1
Promise.then (async)
n.then @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:21
d.prefetch @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:7
f.dynamicImport @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:25
component @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:157
(anonymous) @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
(anonymous) @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
(anonymous) @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
Re @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
(anonymous) @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
p @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
a @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
a @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
(anonymous) @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
(anonymous) @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
s.beforeEach @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:157
p @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
a @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
Oe @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
e @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
e @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
e @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
(anonymous) @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
s.beforeEach @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:157
p @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
a @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
Oe @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
e @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
e @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
e @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
a @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
Nn @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
Va.e._init @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
qa @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9
r.startup @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:157
a @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:1
u @ 19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:1
19937063ae2e425ee107d2413fd967864776394b.js?meteor_js_resource=true:9 TypeError: Failed to fetch

And then I tried the old style, I work fine

import Dashboard from './pages/Dashboard.vue'
{
    path: '/',
    name: 'Dashboard',
    component: Dashboard,
    meta: {
      title: 'Dashboard',
      icon: 'fas fa-tachometer-alt',
      noCache: true,
    },
  },

But it work fine in local

Now I tried import component on the top, but don't use

import Dashboard from './pages/Dashboard.vue'

{
    path: '/',
    name: 'Dashboard',
    // component: Dashboard,
    component: () => import('./pages/Dashboard.vue'),
    meta: {
      title: 'Dashboard',
      icon: 'fas fa-tachometer-alt',
      noCache: true,
    },
  },

It work fine too

I believe this is now solved on the forums right? Closing it for now. Feel free to continue here if you have any problems. Must say that I don't have a lot of experience with MUP these days.

https://forums.meteor.com/t/dynamic-import-in-vue-router-component-dont-work-on-deployment/47685/6