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

Unable to resolve modules when using yarn's PnP linker #130

Closed
meriouma opened this issue Jul 3, 2022 · 10 comments · Fixed by privatenumber/get-tsconfig#28, #133 or #134
Closed

Unable to resolve modules when using yarn's PnP linker #130

meriouma opened this issue Jul 3, 2022 · 10 comments · Fixed by privatenumber/get-tsconfig#28, #133 or #134
Labels

Comments

@meriouma
Copy link

meriouma commented Jul 3, 2022

This is a breaking change in v3. Trying to run eslint with eslint-import-resolver-typescript@3+ yields multiple
error Resolve error: File '@equisoft/typescript-config/tsconfig.standards.json' not found.
4:15 error Unable to resolve path to module './some-module

Reproduction branch : https://github.com/kronostechnologies/tax-ca/tree/get-tsconfig-issue
Steps :

  • yarn install
  • yarn eslint

I believe the issue is caused by the change from tsconfig-paths to get-tsconfig (privatenumber/get-tsconfig#26)

@JounQin
Copy link
Collaborator

JounQin commented Jul 3, 2022

If you already know it's an issue from get-tsconfig, then you don't need to raise this issue?

@meriouma
Copy link
Author

meriouma commented Jul 3, 2022

To document this package doesn't work anymore when using yarn PnP and extending a tsconfig from a dependency?

@JounQin
Copy link
Collaborator

JounQin commented Jul 3, 2022

It depends on get-tsconfig, and you can help to support that.

And I've documented use get-tsconfig to replace tsconfig-paths in v3, and that's why it is a major version.

@JounQin
Copy link
Collaborator

JounQin commented Jul 3, 2022

I noticed you raised privatenumber/get-tsconfig#27, but you just gave up by closing the PR.

Personally I don't use yarn pnp, you need provide a reproduction for get-tsconfig, so that it helps and saves all of our time.

By the mean time, you can still use v2 as workaround for now.

@JounQin
Copy link
Collaborator

JounQin commented Jul 4, 2022

Although this is clearly be a bug from upstream, but I'd like to fix it on our side first, because it should not be so tough because we're already using enhanced-resolve, I'll work on a fix soon.

@JounQin JounQin reopened this Jul 4, 2022
@JounQin
Copy link
Collaborator

JounQin commented Jul 4, 2022

#133

After digging, I found it still should be fixed in get-tsconfig because we have no access to extends field in tsconfig.json.

@meriouma If you are going to fix that issue, I'll just leave it as-is, or I might work on a fix for get-tsconfig instead.

@JounQin
Copy link
Collaborator

JounQin commented Jul 5, 2022

@meriouma eslint-import-resolver-typescript@3.2.2 has been released with PnP support!

@meriouma
Copy link
Author

meriouma commented Jul 6, 2022

Wow, thanks @JounQin for the fast work. although it is causing more issues. Now there are a lot of import error appearing when running eslint :

1:1   error  Resolve error: typescript with invalid interface loaded as resolver  import/no-extraneous-dependencies
1:1   error  Resolve error: typescript with invalid interface loaded as resolver  import/no-unresolved
1:1   error  Resolve error: typescript with invalid interface loaded as resolver  import/no-duplicates
1:1   error  Resolve error: typescript with invalid interface loaded as resolver  import/order
1:1   error  Resolve error: typescript with invalid interface loaded as resolver  import/no-self-import
1:1   error  Resolve error: typescript with invalid interface loaded as resolver  import/no-cycle
1:1   error  Resolve error: typescript with invalid interface loaded as resolver  import/no-useless-path-segments
1:1   error  Resolve error: typescript with invalid interface loaded as resolver  import/no-relative-packages
1:1  error  Unable to resolve path to module './annotators/annotator'            import/no-unresolved
2:27  error  Unable to resolve path to module './converters/converter'            import/no-unresolved
3:28  error  Unable to resolve path to module './model/issue'                     import/no-unresolved
4:24  error  Unable to resolve path to module './model/report'                    import/no-unresolved
5:68  error  Unable to resolve path to module './report-filters'                  import/no-unresolved
6:30 error  Unable to resolve path to module './report-reader'                   import/no-unresolved

I took a look at your PR and I'm not sure what is the change that could cause this issue 🤔

@JounQin
Copy link
Collaborator

JounQin commented Jul 6, 2022

@meriouma See #135, working on a fix.

@meriouma
Copy link
Author

meriouma commented Jul 6, 2022

Oh, right. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment