Webpack:is missing from the TypeScript compilation. ...at AngularCompilerPlugin.getCompiledFile

558 Views Asked by At

I am using angular 10.1.0-next.4 in web application with

   "@ngtools/webpack": "^10.0.0",
    "webpack": "^4.43.0",

and getting error while doing build.

PS D:\app2020\testing\local\angular10\sampleangular10app\myangular10app> ng run myangular10app:build-worker
Hash: 8132eb4a13b2ee0de491
Version: webpack 4.44.1
Time: 134ms
Built at: 08/12/2020 12:01:42 AM
                                          Asset      Size  Chunks  Chunk Names
./src/appResourceFiles/workers/httpWebWorker.js  1.66 KiB       0  ./src/appResourceFiles/workers/httpWebWorker
Entrypoint ./src/appResourceFiles/workers/httpWebWorker = ./src/appResourceFiles/workers/httpWebWorker.js
[0] multi ./src/webWorker/main.worker.ts 28 bytes {0} [built]
[1] ./src/webWorker/main.worker.ts 734 bytes {0} [built] [failed] [1 error]

ERROR in ./src/webWorker/main.worker.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: D:\app2020\testing\local\angular10\sampleangular10app\myangular10app\src\webWorker\main.worker.ts is missing from the TypeScript compilation. Please 
make sure it is in your tsconfig via the 'files' or 'include' property.
    at AngularCompilerPlugin.getCompiledFile (D:\app2020\testing\local\angular10\sampleangular10app\myangular10app\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:935:23)
    at D:\app2020\testing\local\angular10\sampleangular10app\myangular10app\node_modules\@ngtools\webpack\src\loader.js:42:31
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
 @ multi ./src/webWorker/main.worker.ts ./src/appResourceFiles/workers/httpWebWorker[0]
PS D:\app2020\testing\local\angular10\sampleangular10app\myangular10app>

Here is the github sample application. Any configuration or version I need to update or missing?

1

There are 1 best solutions below

1
On

You need to include the project directory to include, otherwise, your code won't be compiled. In tsconfig.app.json change:

"files": [
    ...,
    "node_modules/jqwidgets-scripts/jqwidgets-ts/angular_jqxbargauge.ts"
  ],

or

"include": [
    ...,
    "node_modules/jqwidgets-scripts/jqwidgets-ts/**/*.ts"
  ],