Skip to content

Production build fail with async components #2858

Closed
@victorgarciaesgi

Description

@victorgarciaesgi

Version

3.0.5

Node and OS info

Node 10.7.0, yarn 1.7, mac OS Mojave 10.14.1 Beta 1

Steps to reproduce

Here is the error I get when doing `yarn build``

In development mode I get no errors and I don't know where to search

Here is the error I get

Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 2)
Cannot read property 'stat' of undefined

    at toDepDetails (/Users/victorgarcia/Desktop/Work/Totem/peppy-pro-web/node_modules/cache-loader/dist/index.js:65:14)
    at arrayIterator (/Users/victorgarcia/Desktop/Work/Totem/peppy-pro-web/node_modules/neo-async/async.js:3780:9)
    at timesSync (/Users/victorgarcia/Desktop/Work/Totem/peppy-pro-web/node_modules/neo-async/async.js:2292:7)
    at Object.mapLimit (/Users/victorgarcia/Desktop/Work/Totem/peppy-pro-web/node_modules/neo-async/async.js:3775:5)
    at Array.<anonymous> (/Users/victorgarcia/Desktop/Work/Totem/peppy-pro-web/node_modules/cache-loader/dist/index.js:88:18)
    at arrayEachFunc (/Users/victorgarcia/Desktop/Work/Totem/peppy-pro-web/node_modules/neo-async/async.js:2512:19)
    at Object.parallel (/Users/victorgarcia/Desktop/Work/Totem/peppy-pro-web/node_modules/neo-async/async.js:6867:9)
    at Object.loader (/Users/victorgarcia/Desktop/Work/Totem/peppy-pro-web/node_modules/cache-loader/dist/index.js:87:9)

 @ ./src/views/Home.vue?vue&type=script&lang=ts& 1:0-367 1:383-386 1:388-752 1:388-752
 @ ./src/views/Home.vue
 @ ./src/views lazy ^\.\/.*\.vue$ namespace object
 @ ./src/router/routes.ts
 @ ./src/router/index.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

My route config

# My route config

function loadView(view) {
  return () => import(/* webpackChunkName: "view-[request]" */ `@views/${view}.vue`);
}

// Liste des routes
export const routesList: MyRouteConfig[] = [
  {
    path: '/',
    name: routesNames.HOME,
    meta: {
      requiresAuth: true,
      title: 'Accueil',
    },
    component: loadView('Home'),
  },
  {
    path: '/connexion',
    name: routesNames.CONNEXION,
    meta: {
      noAuth: true,
      title: 'Connexion',
    },
    component: loadView('Connexion'),
  },
  {
    path: '/*',
    meta: {
      title: 'Page non trouvée',
    },
    component: loadView('error404'),
  },
];


### What is expected?
The production build is expected to success

### What is actually happening?
The production build fails when building async components

<!-- generated by vue-issues. DO NOT REMOVE -->

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions