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

masking/types.d.ts imports from "./internal/types.ts" #12170

Closed
Yogu opened this issue Dec 5, 2024 · 4 comments · Fixed by #12171
Closed

masking/types.d.ts imports from "./internal/types.ts" #12170

Yogu opened this issue Dec 5, 2024 · 4 comments · Fixed by #12171

Comments

@Yogu
Copy link

Yogu commented Dec 5, 2024

Issue Description

Starting in @apolllo/[email protected], the file masking/types.d.ts has this import statement:

import type { ContainsFragmentsRefs, IsAny, RemoveFragmentName, RemoveMaskedMarker, UnwrapFragmentRefs } from "./internal/types.ts";

The file types.ts does not exist in the NPM package. The file types.d.ts would exist.

This results in this typescript error

Error: node_modules/@apollo/client/masking/types.d.ts:2:111 - error TS2691: An import path cannot end with a '.ts' extension. Consider importing './internal/types.js' instead.

2 import type { ContainsFragmentsRefs, IsAny, RemoveFragmentName, RemoveMaskedMarker, UnwrapFragmentRefs } from "./internal/types.ts";
                                                                                                                ~~~~~~~~~~~~~~~~~~~~~

The fix is probably to change this line to import from .js instead of .ts.

Link to Reproduction

Let me know if you need this

Reproduction Steps

No response

@apollo/client version

3.12.0

@phryneas
Copy link
Member

phryneas commented Dec 5, 2024

Hi @Yogu,
that's a great catch!

Could you try the CI build from #12171 to see if it fixes the problem?

npm i https://pkg.pr.new/@apollo/client@12171

Copy link
Contributor

github-actions bot commented Dec 5, 2024

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.

@jerelmiller
Copy link
Member

We just released 3.12.1 which should fix this. Thanks for raising the issue!

@Yogu
Copy link
Author

Yogu commented Dec 5, 2024

That was quick, thank you! I just tested 3.12.1 and it seems to fix the issue.

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.

3 participants