Imports breaking on >1.4.0
See original GitHub issueI’m upgrading the dependencies on my projects, and after upgrading tsc-alias (to 1.4.1 or 1.5.0), some of my imports are breaking.
The paths
on my tsconfig is like this:
"paths": {
"~/*": ["./*"]
},
But this
import { Dispatch } from 'redux';
Is becoming
import { Dispatch } from '../../redux';
I think it’s because there is a redux folder on the folder it’s compiling, but it should not be parsed, as it does not begins with ~/
Another problem I had, was because some paths were not being parsed if an asset was not present (on the release script they were added afterwards)
This import was not parsed if the svg file was not present in the dist folder
export { default as iconx } from '~/assets/icons/iconx.svg';
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Import broken by sqlalchemy 1.4.0 · Issue #505 - GitHub
1.4 left beta yesterday, so I think this is more urgent now than it was. All reactions.
Read more >findimports - PyPI
Python module import analysis tool. ... 1.4.0 (2015-06-04) ... Fixed broken and uninstallable source distribution by adding a MANIFEST.in.
Read more >Traps for the Unwary in Python's Import System
Python's import system is powerful, but also quite complicated. ... due to broken imports (either failing to find example for absolute imports like...
Read more >cannot import name '_ColumnEntity' from 'sqlalchemy.orm ...
I just pip installed apache-superset fresh. it complained with "flask-appbuilder 3.2.2 requires SQLAlchemy<1.4.0, but you'll have sqlalchemy 1.4 ...
Read more >Go 1.4 Release Notes - The Go Programming Language
Import paths for the subrepositories: The go generate subcommand: Change to file ... and a possibly breaking change to the compiler involving methods...
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 Free
Top 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
@ThiagoNP
This is probably because it’s resolving to the baseUrl. This could be solved by add a small config to tsconfig.json. More info on this is in issue #71
The second problem happens because tsc-alias checks if the file exists, because if it doesn’t it will use the next path in the array (in the tsconfig each path has an array of solutions). But this problem can be easily fixed by added dummy files so that the file exists and resolves.
@justkey007 Maybe we should add a link to the F.A.Q. #110 in the readme?