Today, when I started the project, I couldn’t get up. I always reported an error. After translation research, I came to the solution
When executing Vue project NPM run dev
FileManager webpack plugin
error typeerror: cannot read property 'isfile' of undefined
D:\abinwork\fmis_web\node_modules\filemanager-webpack-plugin\lib\index.js:271
if (isGlob) archive.glob(command.source, globOptions);else if (sStats.isFile()) archive.file(command.source, {
name: path$1.basename(command.source) });else if (sStats.isDirectory()) archive.glob('**/*', {
^
TypeError: Cannot read property 'isFile' of undefined
at D:\abinwork\fmis_web\node_modules\filemanager-webpack-plugin\lib\index.js:271:79
at D:\abinwork\fmis_web\node_modules\graceful-fs\polyfills.js:282:31
The reason for the error is very simple, because the project we just pulled down does not have a dist directory, and then FileManager webpack plugin
find a dist directory and find that it does not exist, and then strike and quit, resulting in an error;
There are two solutions
First, you can repackage it;
npm run build
Second, modify the configuration and automatically create the dist directory when running
Note: look at the first step first. If you can run the NPM run build
and then the NPM run dev
project, you don’t have to perform the second step
plugins: [
new FileManagerWebpackPlugin ({
onEnd: {
mkdir: [‘./dist‘],
delete: [
‘./dist.zip‘,
],
archive: [
{source: ‘./dist‘, destination: ‘./dist.zip‘},
]
}
})
],
Read More:
- [Solved] Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined
- [Solved] Cannot read property ‘setCheckedKeys‘ of undefined“
- [Solved] HBuilder Error: Cannot read property ‘forceUpdate‘ of undefined
- Uni-app Error when assigning a value to a component: [system] TypeError: Cannot read property ‘name‘ of undefined
- [Solved] Syntax Error: TypeError: Cannot read property ‘parseComponent‘ of undefined
- Vue cannot read property ‘xxx’ of undefined solutions
- [Solved] electron Error: Uncaught TypeError: Cannot read property ‘BrowserWindow‘ of undefined
- [Solved] Vue element UI form verification error: cannot read property ‘validate’ of undefined
- [Solved] Install The Latest Version of Jest Error: TypeError: Cannot read property ‘instrument‘ of undefined
- [Solved] TYPEERROR: CANNOT READ PROPERTY ‘REDUCE‘ OF UNDEFINED
- [Solved] Echarts Error: Cannot read property ‘init‘ of undefined
- [Solved] Vue Error: TypeError: Cannot read property ‘end‘ of undefined
- Echarts Partially introduced error: TypeError: Cannot read property ‘findAxisModel’ of undefined
- Echarts Map Error: Error: Invalid geoJson format Cannot read property ‘length‘ of undefined
- [Solved] Syntax Error: TypeError: Cannot set property ‘parent‘ of undefined
- [Solved] JS Error: cannot set property xxx of undefined
- [Solved] vue.esm.js?efeb:591 [Vue warn]: Error in event handler for “click“: “TypeError: Cannot read property
- [Vue warn]: Error in render: “TypeError: Cannot read properties of undefined
- [Solved] Uni.createintersectionobserver Error: Uncaught TypeError: Cannot read property ‘bottom’ of null
- [Solved] Element form method Error: TypeError: Cannot read properties of undefined (reading ‘resetFields’)