In some cases, the following errors will occur when using the ruoyi background:
According to the prompt, we can find that the main code causing this problem is the following paragraph:
export const loadView = (view) => {
return () => import(`@/views/${view}`)
}
Global search node_ Modules
we can see that this problem is a warning given by the 224
line of lib/dependencies/contextdependencyhelpers. JS
of webpack
Then, relevant questions can be found in the official issues
However, it seems that the government has not given a solution (or maybe I have not found it). Maybe the government does not agree with the introduction of Import ('@/views/${view}')
We can also try to introduce it in a different way, for example:
export const loadView = (view) => {
return () => Promise.resolve(require(`@/views/${view}`).default)
}
In this way, the component can be loaded asynchronously, and no exception will be reported by webpack
, Terminal
looks much more comfortable
Similar Posts:
- How to Copy Echarts Map Examples to Local vueCLI Project (Commissioning Operation)
- TypeError: CleanWebpackPlugin is not a constructor
- Vue compatible ie error reporting solution
- [eslint] Unexpected block statement surrounding arrow body; move the returned value immediately a…
- [Solved] Vue cli 3.0 error: “Failed to load resource: net::ERR_FILE_NOT_FOUND”
- Webpack reports an error when using the cleanwebpackplugin plug-in
- Webpack high version pulls out CSS style and reports an error [Solved]
- OSX PyCharm Error: Probably the path to Git executable is not valid. [How to Fix]
- Vue Request Error: Uncaught (in promise) [How to Solve]
- Causes and solutions of error reporting in require setting dynamic path