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

[7.0.1] broken types #846

Closed
efstathiosntonas opened this issue May 11, 2024 · 16 comments
Closed

[7.0.1] broken types #846

efstathiosntonas opened this issue May 11, 2024 · 16 comments
Labels

Comments

@efstathiosntonas
Copy link

After upgrading to 7.0.1 IDE complains about typings.

Screenshot

Screenshot 2024-05-11 at 11 39 45

Description

Reproduction Steps/Repo Link

@AbdUlHamedMaree
Copy link

I opened an issue yesterday and it was closed, and many others, the issue is TypeScript compiler doesn't read the exports field in the package.json yet and relays only on the types field, in the v7 types field got removed

@efstathiosntonas
Copy link
Author

closing, duplicate: #844

@AbdUlHamedMaree
Copy link

@jasonkuhrt I believe we need the types field back, just for backward compatibility

@AbdUlHamedMaree
Copy link

@efstathiosntonas but that issue got closed as well 🥲

@efstathiosntonas
Copy link
Author

@AbdUlHamedMaree how did you managed to solve this? can you share your tsconfig?

@AbdUlHamedMaree
Copy link

@efstathiosntonas just change moduleResolution to be Bundler, but the issue with that, it might break other stuff

@efstathiosntonas
Copy link
Author

efstathiosntonas commented May 11, 2024

did that earlier and it breaks everything, got like 200 errors lol.

@jasonkuhrt can you please bring the types back? It's a tremendous breaking change.

@AbdUlHamedMaree
Copy link

oh yeah it did break the building process 🥲

@jasonkuhrt
Copy link
Owner

Have you enabled package.exports on your React Native project? https://reactnative.dev/blog/2023/06/21/package-exports-support

@jasonkuhrt
Copy link
Owner

jasonkuhrt commented May 11, 2024

@AbdUlHamedMaree
Copy link

@jasonkuhrt You're totally right, didn't expect types field to be legacy, but yeah using moduleResolution: "bundler" fixed my issue, but afraid of others that relays on TSC to bundle their libraries or applications, Thanks anyway!

@Zerebokep

This comment was marked as off-topic.

@jasonkuhrt
Copy link
Owner

jasonkuhrt commented May 15, 2024

@Zerebokep is that a runtime error or TS error. Looks like a runtime error. Confirm? If so, Node version?

@Zerebokep
Copy link

Yup, runtime, I'm using node 22.1.0.

@jasonkuhrt
Copy link
Owner

Then it's not about broken types. New issue welcome, thanks!

@Zerebokep
Copy link

Strangely it works on another container with a similar setup, I'm even using the same tsconfig there. Not sure if it's relevant, but I'm using pnpm as package manager and tsx to execute the script. I've also checked the package.json of graphql-request node_modules folder, it's identical for both containers, exports are included.

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

No branches or pull requests

4 participants