Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error " Error: AngularCompilerPlugin is running in a child compilation, but couldnot find a WebpackCompilerHost in the parent compilation." #3368

Open
jha-pankaj opened this issue Oct 21, 2024 · 0 comments

Comments

@jha-pankaj
Copy link

In My project workbox-webpack-plugin is used.
It was working fine till angular 10. when i Migrated it to 11, i got error in "npm run build" command .
Error-
" Error: AngularCompilerPlugin is running in a child compilation, but couldnot find a WebpackCompilerHost in the parent compilation."
my workbook config file -

const { InjectManifest } = require('workbox-webpack-plugin');
const AotPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
const path = require('path');

module.exports = {
plugins: [
new InjectManifest({
maximumFileSizeToCacheInBytes: "26214400",
compileSrc: true,
swDest: "service-worker.js",
swSrc: "./src/app/utilities/service-worker.ts",
webpackCompilationPlugins: [
new AotPlugin({
tsConfigPath: path.join(__dirname, '../src/tsconfig.app.json'),
// mainPath: path.join(__dirname, './src/main.ts'),
// typeChecking: false,
}),
]
})
]
};

I am using -
"workbox-routing": "^5.1.3",
"workbox-precaching": "^5.1.3",
"workbox-core": "^5.1.3",
"workbox-webpack-plugin": "^5.1.3"
"workbox-cli": "^5.1.3",
"webpack-cli": "^3.3.7",

tsconfig file
{
"compileOnSave": false,
"compilerOptions": {
"downlevelIteration": true,
"importHelpers": true,
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es2018",
"skipLibCheck": true,
"typeRoots": ["node_modules/@types"],
"lib": ["es2017", "dom", "webworker"],
"module": "ES2020",
"baseUrl": "./",
"strict": false
}

}
COuld you please help me to resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant