Skip to content
Source
Sign inSign up
TanStack/query

react-native resolve problem #7717

Send to my agent
Closedkerm1it(GitHub profile, opens in a new tab) opened this issue 1 comment

Describe the bug

I am using v4 in the react-native project

If the entry file to be parsed is the module of package.json, the corresponding file is index.esm.js. Then the problem comes.

Starting from index.esm.js, all file parsing is complete suffix, which will cause the react-native environment-specific files to not be parsed, such as reactBatchedUpdates.native.js, reactBatchedUpdates.native.esm.js, useSyncExternalStore.native.js and useSyncExternalStore.native.esm.js etc.

So can we add a react-native field in package.json, and the entry file is index.ts in src, so that it can be parsed correctly in react-native.

Although it can be solved by some ways, or resolverMainFields in metro is main, but this cannot useesm format, and other react-native libraries point to src source code through react-native of package.json

Your minimal, reproducible example

https://snack.expo.dev

Steps to reproduce

nothing

Expected behavior

can use module of package.json point in react-native

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

All

Tanstack Query adapter

None

TanStack Query version

4.x

TypeScript version

No response

Additional context

No response

  1. not sure how to help here. in v5, we've removed the react-native specific code. I don't think we'll be making changes to v4 and I think it's best you update to v5

  2. TkDodo closed this

  3. TkDodo added labelswontfix

  4. TkDodo added labelsv4

Sign in to join this conversation.