Reputation: 46900
When including @fireflysemantics/slice
in an Angular project I get the following error message:
ERROR in ./node_modules/@fireflysemantics/slice/index.ts
Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: /home/ole/Temp/fstest/node_modules/@fireflysemantics/slice/index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
I tried including index.ts
like this in an include
block:
"include": ["./node_modules/@fireflysemantics/slice/index.ts"],
However, I still get the same error. I posted the reproduction of it in this Angular bug report.
Upvotes: 0
Views: 2097
Reputation: 4117
It's mistake by developer of @fireflysemantics/slice
, as developer is including ts
files in the library, this is not standard understandable by Angualr hence the error
Error: C:\Users\demo\Documents\angular\demong\node_modules@fireflysemantics\slice\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library.
Until the developer makes the changes in the library, you need to remove index.ts
file from node_modules\@fireflysemantics\slice
.
After removing index.ts
, angular will use valid index.js
from same directory.
After removing the index.ts
file, ng serve
again, it should work.
Also until developer fixes it, you can add following in package.json
to start your application by npm start
. It'll take care of the file.
"start": "rm -f \"node_modules/@fireflysemantics/sliceng/index.ts\" && ng serve",
Upvotes: 1
Reputation: 26720
As I've sent a reply to the issue that you've posted on the Angular CLI repository, I'll just post a TL;DR version of the reply:
The issue is caused by a broken compilation, resulting in a format not aligned with the Angular Package Format and causing the error that you're facing.
As such, I suggest that you either post a new issue to the library author regarding this concern, or you downgrade your local installation of the library to v9.0.1
or below.
Hope this helps!
Upvotes: 0