Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsc-alias incorrectly replace a module when a file with same name exists in the current directory #199

Closed
SwingCosmic opened this issue Sep 4, 2023 · 2 comments

Comments

@SwingCosmic
Copy link

SwingCosmic commented Sep 4, 2023

I have a file named axios.ts . If any file includes import axios from "axios" in the same directory, it will be replaced to const axios_1 = require("./axios"), not use the dependency in node_modules !

tsconfig.json sets baseUrl to ".".

Debug log:

tsc-alias debug: default replacer - requiredModule:  'axios'
tsc-alias debug: default replacer - alias:
tsc-alias debug: base-url replacer - requiredModule:  'axios'
tsc-alias debug: base-url replacer - relativePath:  './'
tsc-alias debug: base-url replacer - newImportScript:  'import(".//axios")'
tsc-alias debug: base-url replacer - modulePath:  './/axios'
tsc-alias debug: replaced file with changes: 'E:/dev/work/node/test/server/axios.d.ts'
@olalonde
Copy link

Dupe: #197

@dvqc
Copy link
Contributor

dvqc commented May 15, 2024

This should be closed after #218 PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants