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

v9.4.0 cannot resolve .d.ts files #1504

Closed
falsandtru opened this issue Sep 19, 2022 · 7 comments · Fixed by #1506
Closed

v9.4.0 cannot resolve .d.ts files #1504

falsandtru opened this issue Sep 19, 2022 · 7 comments · Fixed by #1506

Comments

@falsandtru
Copy link

ts-loader was able to resolve index.d.ts from index.ts until v9.3.1, but cannot do it since v9.4.0. The errors occurs on Ubuntu 20.04 but doesn't on Windows 10.

Expected Behaviour

no error

Actual Behaviour

ERROR in /home/runner/work/pjax-api/pjax-api/index.ts
./index.ts 1:9-15
[tsl] ERROR in /home/runner/work/pjax-api/pjax-api/index.ts(1,10)
      TS2303: Circular definition of import alias 'Config'.
 @ ./test/integration/index.test.ts 7:16-38

https://github.com/falsandtru/pjax-api/actions/runs/3081442336/jobs/4980275627

Steps to Reproduce the Problem

Check out falsandtru/pjax-api@76ad376 on Ubuntu.
Run npm i && npm run dist.

Location of a Minimal Repository that Demonstrates the Issue.

falsandtru/pjax-api@76ad376

@xemlock
Copy link

xemlock commented Sep 19, 2022

Ran into exactly the same issue today. ts-loader@9.4.0 was resolving a local file instead of a d.ts file from node_modules/@types, reporting a false positive circular type definition.

@johnnyreilly
Copy link
Member

This was likely caused by #1503

@manuth would you be able to take a look please? If we can resolve this quickly that'd be great - if we can't then we'll likely have to revert 9.4.0 for now.

For others bumping on this, please pin to 9.3.1 for now. We'll look to either revert or fix in the near future. @falsandtru thanks for the repro.

@manuth
Copy link
Contributor

manuth commented Sep 19, 2022

This was likely caused by #1503

@manuth would you be able to take a look please? If we can resolve this quickly that'd be great - if we can't then we'll likely have to revert 9.4.0 for now.

For others bumping on this, please pin to 9.3.1 for now. We'll look to either revert or fix in the near future. @falsandtru thanks for the repro.

We could go forward and disable enhanced-resolver as it used to be.

I will try to work it out using your repository, @falsandtru.

@manuth
Copy link
Contributor

manuth commented Sep 19, 2022

@falsandtru Sadly I could not find myself able to reproduce the issue. For me, the command webpack --env mode=test is working properly using your most recent commit 418756d009a14b300f00a7f75831030ff0a6496a.

Could you please tell me how to reproduce the issue? Is there any other repository or code example causing this error?

@manuth
Copy link
Contributor

manuth commented Sep 19, 2022

@xemlock could you please tell me on which repository and what branch you're facing this issue?

@falsandtru
Copy link
Author

falsandtru commented Sep 20, 2022

@manuth I already fixed the issue on master branch. Please use the commit written in #1504 (comment).

Or revert the change falsandtru/pjax-api@23f3db5

@manuth
Copy link
Contributor

manuth commented Sep 20, 2022

@falsandtru Thank you so much for providing your example workspace!
Sorry for not noticing the link you have posted the specific commit.

I could pinpoint the issue and will fix it asap.

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

Successfully merging a pull request may close this issue.

4 participants