_ _ webpack_require__.e is not a function

in laravel+vue "s project, give vue a lazy load using vue-router "s routing.

is in the configuration file of router. There is no problem with normal import

import Home from "./../js/views/home.vue"                


  1. but just load
using routing laziness
const Home = r => require.ensure([], () => r(require("./../js/views/home.vue")))

will report the above error. I don"t know why

Apr.02,2021

const Home=()=>import('./../js/views/home.vue')

try the following

const Home=()=>Promise.resolve(require('./../js/views/home.vue'))

upgraded to webapck3.0, using the extract-text-webpack-plugin plug-in. This plug-in must be configured in 3. 0 with a parameter called allChunks: true

https://codeshelper.com/a/11.

Menu