У меня есть приложение angular, где я не использую никаких встроенных компоновщиков для создания или обслуживания приложения. Вместо этого, поскольку я использую демонстрационную версию Webpack 5, я вынужден использовать пользовательскую конфигурацию для веб-пакета.
Итак, при запуске команды serve я получаю сообщение об ошибке:
TypeError: Cannot destructure property 'startTime' of 'snapshot' as it is null.
at FileSystemInfo._checkSnapshotValidNoCache (/home/alecoder/Projects/JS/ap/node_modules/webpack/lib/FileSystemInfo.js:1159:4)
at FileSystemInfo.checkSnapshotValid (/home/alecoder/Projects/JS/ap/node_modules/webpack/lib/FileSystemInfo.js:1153:8)
at processCacheResult (/home/alecoder/Projects/JS/ap/node_modules/webpack/lib/cache/ResolverCachePlugin.js:253:26)
at /home/alecoder/Projects/JS/ap/node_modules/webpack/lib/Cache.js:93:5
at Hook.eval [as callAsync] (eval at create (/home/alecoder/Projects/JS/ap/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:14:1)
at Cache.get (/home/alecoder/Projects/JS/ap/node_modules/webpack/lib/Cache.js:75:18)
at /home/alecoder/Projects/JS/ap/node_modules/webpack/lib/cache/ResolverCachePlugin.js:300:15
at Hook.eval [as callAsync] (eval at create (/home/alecoder/Projects/JS/ap/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:20:1)
at Resolver.doResolve (/home/alecoder/Projects/JS/ap/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:245:16)
at Resolver.resolve (/home/alecoder/Projects/JS/ap/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:158:16)
Команда подачи
"webpack:serve": "node --max-old-space-size=8192 node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.dev.config.js --host \"dev.someurl.com\" --port 443"
Вот зависимости:
"dependencies": {
"@angular/animations": "~9.1.0",
"@angular/common": "~9.1.0",
"@angular/compiler": "~9.1.0",
"@angular/core": "~9.1.0",
"@angular/forms": "~9.1.0",
"@angular/platform-browser": "~9.1.0",
"@angular/platform-browser-dynamic": "~9.1.0",
"@angular/router": "7.2.15",
"@fortawesome/angular-fontawesome": "^0.4.0",
"@fortawesome/fontawesome-svg-core": "^1.2.28",
"@fortawesome/free-solid-svg-icons": "^5.13.0",
"@ngrx/effects": "^7.4.0",
"@ngrx/entity": "^7.4.0",
"@ngrx/router-store": "^7.4.0",
"@ngrx/store": "^7.4.0",
"concurrently": "^5.1.0",
"core-js": "^2.6.11",
"google-maps": "^3.3.0",
"http-server": "^0.12.3",
"json-stringify": "^1.0.0",
"lite-server": "^2.5.4",
"mini-css-extract-plugin": "^0.9.0",
"ng-un-slider": "1.1.67-alpha-27",
"ng2-nouislider": "1.7.13",
"ngrx-store-localstorage": "^7.0.1",
"ngx-build-plus": "^9.0.4",
"nouislider": "^12.1.0",
"precss": "^4.0.0",
"rxjs": "^6.5.3",
"rxjs-compat": "6.5.3",
"tslib": "^1.11.1",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/architect": "file:libs/_angular-devkit_architect.tgz",
"@angular-devkit/architect-cli": "file:libs/_angular-devkit_architect-cli.tgz",
"@angular-devkit/build-angular": "file:libs/_angular-devkit_build-angular.tgz",
"@angular-devkit/build-ng-packagr": "file:libs/_angular-devkit_build-ng-packagr.tgz",
"@angular-devkit/build-optimizer": "file:libs/_angular-devkit_build-optimizer.tgz",
"@angular-devkit/build-webpack": "file:libs/_angular-devkit_build-webpack.tgz",
"@angular-devkit/core": "file:libs/_angular-devkit_core.tgz",
"@angular-devkit/schematics": "file:libs/_angular-devkit_schematics.tgz",
"@angular-devkit/schematics-cli": "file:libs/_angular-devkit_schematics-cli.tgz",
"@angular/cli": "file:libs/_angular_cli.tgz",
"@angular/compiler-cli": "~9.1.0",
"@angular/language-service": "~9.1.0",
"@angular/pwa": "file:libs/_angular_pwa.tgz",
"@ngrx/store-devtools": "^7.4.0",
"@ngtools/webpack": "file:libs/_ngtools_webpack.tgz",
"@schematics/angular": "file:libs/_schematics_angular.tgz",
"@schematics/schematics": "file:libs/_schematics_schematics.tgz",
"@schematics/update": "file:libs/_schematics_update.tgz",
"@types/google-maps": "^3.2.2",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"circular-dependency-plugin": "^5.2.0",
"clean-webpack-plugin": "^3.0.0",
"codelyzer": "^5.1.2",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^3.5.3",
"css-to-string-loader": "^0.1.3",
"extract-text-webpack-plugin": "^3.0.2",
"file-loader": "^6.0.0",
"html-loader": "^1.1.0",
"html-webpack-plugin": "git://github.com/ScriptedAlchemy/html-webpack-plugin.git#master",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.4.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"midas": "^2.0.3",
"ngrx-store-freeze": "^0.2.4",
"node-sass": "^4.13.1",
"npm-force-resolutions": "0.0.3",
"postcss-loader": "^3.0.0",
"postcss-nested": "^4.2.1",
"protractor": "~5.4.3",
"raw-loader": "^4.0.1",
"resolve": "^1.17.0",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"serve": "^11.3.0",
"source-map-loader": "^0.2.4",
"style-loader": "^1.2.1",
"suppress-chunks-webpack-plugin": "^1.0.6",
"to-string-loader": "^1.1.6",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "^3.8.3",
"url-loader": "^4.1.0",
"webpack": "git://github.com/webpack/webpack.git#dev-1",
"webpack-bundle-analyzer": "^3.7.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3",
"webpack-virtual-modules": "^0.2.1"
}
Вот конфигурация веб-пакета:
const AotPlugin = require("@ngtools/webpack").AngularCompilerPlugin;
const HtmlWebpackPlugin = require("html-webpack-plugin");
const path = require("path");
const { resolve } = require('path');
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const shellConfig = {
devtool: 'eval',
mode: "development",
entry: ["./src/polyfills.ts", "./src/main.ts"],
node: false,
devServer: {
contentBase: path.join(__dirname, "dist")
},
output: {
path: resolve('./dist'),
filename: '[name].js',
},
resolve: {
extensions: ['.ts', '.js'],
mainFields: ["browser", "module", "main"]
},
performance: {
hints: false,
},
module: {
rules: [
{
test: /\.ts$/,
loader: "@ngtools/webpack"
},
{
test: /\.js$/,
exclude: /(ngfactory|ngstyle).js$/,
enforce: 'pre',
use: 'source-map-loader'
},
{
test: /\.html$/,
use: 'raw-loader'
},
{
test: /\.css$/,
use: ['to-string-loader', 'css-loader']
},
// {
// test: /\.css$/,
// use: ['style-loader', 'css-loader'],
// include: [resolve('./src/styles.css')]
// },
// {
// test: /\.(eot|svg|cur)$/,
// loader: 'file-loader',
// options: {
// name: `[name].[ext]`,
// limit: 10000
// }
// },
// {
// test: /\.(jpg|png|webp|gif|otf|ttf|woff|woff2|ani)$/,
// loader: 'url-loader',
// options: {
// name: `[name].[ext]`,
// limit: 10000
// }
// },
// {
// test: /[\/\\]@angular[\/\\]core[\/\\].+\.js$/,
// parser: { system: true },
// }
]
},
plugins: [
new HtmlWebpackPlugin({
template: "./src/index.html"
}),
new AotPlugin({
//mainPath: resolve('./src/main.ts'),
sourceMap: false,
nameLazyFiles: false,
tsConfigPath: resolve('./src/tsconfig.app.json'),
skipCodeGeneration: true,
compilerOptions: {
enableIvy: false,
}
}),
//new SuppressExtractedTextChunksWebpackPlugin(),
new ProgressPlugin(),
new CircularDependencyPlugin({
exclude: /[\\\/]node_modules[\\\/]/
}),
]
};
module.exports = [shellConfig];
Есть идеи, почему я получаю эту ошибку?