Breaking change on `v1.4.2`: replacement for non-alias :exploding_head:
See original GitHub issueHi! I’ve got a second bug spotted on (first minor here), and since 1.4.2 and I think this one is quite interesting as it’s replacing a NodeJs native library import statement.
Description / steps to reproduce
tsconfig.json
alias config doesn’t matter!
"path": {} // empty
- file to convert
/utils/index.js
, which does contain a Node.js native package (for instance cluster, but it works for achild_process
,fs
or whatever)
const cluster = require("cluster");
- And, I’ve got some file
/cluster.js
:
// the bug occurs as long the file "cluster" exists
The /utils/index.js
will be rewritten as following 🤯 🤯 🤯
const cluster = require("../cluster");
Origin
That’s not the same source as the minor bug I’ve spot! This issue is coming from this commit: https://github.com/justkey007/tsc-alias/commit/18b252a5de960b813490ce6fa6e3a447b943d61e
// Finding breaking change in tagged versions
1.4.1: OK! :)
1.4.2: BROKEN!
// Finding breaking in commits
e980fee75851012c52878c0d23c2dc05fe83bce4: (1.4.1): OK
18b252a5de960b813490ce6fa6e3a447b943d61e: BROKEN
... note it's broken to current version 1.6.4
I’m trying to spot exactly which code did this regression, probably replaceBaseUrlImport
but I’m not sure to be able to edit this code without breaking things 😞
Let me know if I can help
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Choosing between alias and non-alias records
Choose whether you want to create alias records in Amazon Route 53.
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
“All module imports with non-relative names are assumed to be relative to the baseUrl.” -typescript handbook This is why base-url is enabled by default.
The name of BaseUrl has been changed to
base-url
all lowercase.