Using declarationMap is causing unexpected errors
See original GitHub issueType of Issue
[ x] Bug Report
[ ] Feature Request
(perhaps it’s an unsupported ts feature, and we should threat this as a feature request)
Description
I’ve tried to use the tsconfig property declarationMap
for getting sources with generated libraries. (see https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#new---declarationmap). Enabling this flag on a project in an angular-cli generated project (either ng 8 or v9.0.0-rc.4
), causes the following issues:
ERROR: error TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'.
An unhandled exception occurred: error TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'.
The message indicates that I should add ‘declaration’ or ‘composite’ as well. In the default generated tsconfig.lib.json
, the declaration is actually set to true. I’ve tried to enable the ‘composite’ flag as well, but this is causing other issues.
How To Reproduce
- create a new cli workspace (
ng new mywebsite
) - create a new project in the workspace (
ng g library myproject
) - add the flag
declarationMap
toprojects/myproject/tsconfig.lib.json
- build the library (
ng build myproject
)
Expected Behaviour
I was expecting that .d.ts.map
files would be generated
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 5.7.1
@angular/*: 8.3.20
typescript: 3.5.3
rxjs: 6.4.0
node: v10.16.0
npm: 6.13.1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Using declarationMap is causing unexpected errors
In the default generated tsconfig. lib. json , the declaration is actually set to true. I've tried to enable the 'composite' flag as...
Read more >TypeScript errors and how to fix them
Common Errors Below you find a list of common TypeScript errors along with the buggy code and its fixed version.
Read more >TSConfig Reference - Docs on every TSConfig option
A TSConfig file in a directory indicates that the directory is the root of a TypeScript or ... This can cause some errors...
Read more >error TS5023: Unknown compiler option 'declarationMap'
When running my program I get the following error: error TS5023: Unknown compiler option 'declarationMap'. My tsconfig file looks like this:
Read more >Compiler Options - Microsoft Open Source
Specifies an array of files to include in the program. An error occurs if any of the files can't be found. composite. Default:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
While I understand being busy, this feature is very important for mono-repo development. Without this working, VS code ends up loading the
*.d.ts
files instead of the source files.Example layout:
In the
angular-application
, to get Ivy working, one cannot use symlinks and tsconfig paths to getangular-application
to reference something in one of the libraries since it usespackage.json
andnode_modules
. When trying to go to the definitionBar
defined inangular-libraries/projects/some-library/src/bar.ts
file fromangular-application/src/foo.ts
file, opened file isangular-application/node_modules/some-library/lib/bar.d.ts
which is not helpful at all if you mean to edit thebar.ts
source code.If I understand this right, having the
declarationMap
working would allow thatbar.ts
file be loaded instead, making the development experience in a mono-repo much better.This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
This action has been performed automatically by a bot.