incorrect paths for import statement is generated
See original GitHub issueType of Issue
[x] Bug Report
[ ] Feature Request
Description
incorrect paths for import statement can be generated when a project has multiple library workspaces.
I think the following issue is similar to this issue. https://github.com/ng-packagr/ng-packagr/issues/1109
How To Reproduce
I created a repository for reproduce this bug.
git clone https://github.com/musou1500/test-angular-workspace
ng build lib2 && ng build lib1
- open
dist/lib1/lib/lib1.service.d.ts
. then you can see an incorrect path for import onLib1Service.test
method.
// should be ../../../dist/lib2/lib2
test(): import("../../../../dist/lib2/lib2").Entity;
Expected Behaviour
the correct path for import statements should be generated.
Version Information
$ node_modules/.bin/ng-packagr --version
ng-packagr: 5.5.1
@angular/compiler: 8.2.7
rollup: 1.21.4
tsickle: 0.36.0
typescript: 3.5.3
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:8
Top Results From Across the Web
Typescript path resulting in wrong import - Stack Overflow
compilerOptions.baseUrl is being prefixed to path specified in import statement to create path relative to the location of tsconfig.json ...
Read more >Configuring the Style of Imports in JavaScript and TypeScript
Find out how to configure the style of imports that are added in the project to make sure everything looks just right.
Read more >Import Statements | Qt QML 6.4.1
An import statement allows clients to tell the engine which modules, JavaScript resources and component directories are used within a QML document.
Read more >Chapter 8 – Reading and Writing Files
Since os.path is a module inside the os module, you can import it by simply ... True if the argument is an absolute...
Read more >Absolute vs Relative Imports in Python
How Imports Work; Syntax of Import Statements; Styling of Import Statements ... Python then searches for it in a list of directories defined...
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
See this as well for builds of https://github.com/graycoreio/daffodil. I was able to work around it by directly referencing the type in the child library. This appears to only happen for
inferred
types.We had a similar issue yesterday. Was using a sibling library in a library using it’s alias name “@somename/some-library” and imports were being transformed to relative paths. This was causing usage issues.