Closed milos201 closed 1 month ago
➤ PM Bot commented:
Jira ticket: RJS-2756
@milos201 I am not able to reproduce it. In which file did you add import { useRealm, useQuery } from '@realm/react'
? The error message indicates that you didn't add the import to a .tsx
file.
@milos201 I am not able to reproduce it. In which file did you add
import { useRealm, useQuery } from '@realm/react'
? The error message indicates that you didn't add the import to a.tsx
file.
That's correct. Error comes from typescript compiler with default TS configuration when creating react native app.
Per the error message, you should add "type": "module"
to your package.json or employ some of the other suggestions to use ES6 modules.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
How frequently does the bug occur?
Always
Description
The following import is reported as error when importing anything from @realm/react in a brand new React Native TypeScript project:
Message:
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
npx react-native@latest init AwesomeProject
1.5cd ./AwesomeProject
yarn add realm @realm/react
useRealm
from@realm/react
anywhereVersion
0.6.2
What services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
macOS Sonoma 14.1 - Visual Studio Code v1.87.1
Build environment
No response
Cocoapods version
No response