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

Realm package path . is not exported - expo #6238

Closed
martilopez opened this issue Nov 7, 2023 · 6 comments
Closed

Realm package path . is not exported - expo #6238

martilopez opened this issue Nov 7, 2023 · 6 comments
Labels
O-Community Waiting-For-Reporter Waiting for more information from the reporter before we can proceed

Comments

@martilopez
Copy link

martilopez commented Nov 7, 2023

I'm working on a react-native project with expo and i've come across this bug.

Whenever installing realm using:

expo init MyAwesomeRealmApp --template @realm/expo-template
I get the following error:

`ERROR in ./app/AppWrapperSync.tsx:11
Module not found: Package path . is not exported from package C:\Users\marti\Desktop\TFG\Guaki\node_modules\realm (see exports field in C:\Users\marti\Desktop\TFG\Guaki\node_modules\realm\package.json)
9 |
10 | import {RealmProvider} from '@realm/react';

11 | import {OpenRealmBehaviorType, OpenRealmTimeOutBehavior} from 'realm';
12 |
13 | export const AppWrapperSync: React.FC<{
14 | appId: string;

ERROR in ./app/models/Task.ts:9
Module not found: Package path . is not exported from package C:\Users\marti\Desktop\TFG\Guaki\node_modules\realm (see exports field in C:\Users\marti\Desktop\TFG\Guaki\node_modules\realm\package.json)
7 | // for an example of this.
8 |

9 | import Realm from 'realm';
10 |
11 | // To use a class as a Realm object type in Typescript with the @realm/babel-plugin plugin,
12 | // simply define the properties on the class with the correct type and the plugin will convert

ERROR in ./node_modules/@realm/react/dist/index.js 2:0-26
Module not found: Error: Package path . is not exported from package C:\Users\marti\Desktop\TFG\Guaki\node_modules\realm (see exports field in C:\Users\marti\Desktop\TFG\Guaki\node_modules\realm\package.json)

web compiled with 3 errors`

I've tried reinstalling realm, downgrading versions and creating a new project. Whatever i do the error shows up.

@kneth
Copy link
Contributor

kneth commented Nov 8, 2023

@martilopez Can you provide details about your Windows installation (architecture, version, node version, etc.)?

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Nov 8, 2023
@martilopez
Copy link
Author

Im using node version 21.1.0. My pc s x64 and is in version 22H2 of windows.
This is my package.json file:

  "name": "guaki",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@expo/webpack-config": "^19.0.0",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/native-stack": "^6.9.17",
    "@realm/react": "^0.6.1",
    "expo": "~49.0.15",
    "expo-dev-client": "^2.4.12",
    "expo-linear-gradient": "~12.3.0",
    "expo-status-bar": "~1.6.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-i18next": "^13.3.1",
    "react-native": "0.72.6",
    "react-native-get-random-values": "^1.9.0",
    "react-native-web": "~0.19.6",
    "realm": "^12.3.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@types/react": "~18.2.14",
    "babel-plugin-module-resolver": "^5.0.0",
    "sharp-cli": "^4.1.1",
    "typescript": "^5.2.2"
  },
  "private": true
}

And this is the error im getting:
ERROR in ./node_modules/@realm/react/dist/index.js 2:0-26
Module not found: Error: Package path . is not exported from package C:\Users\marti\Desktop\Guaki\node_modules\realm (see exports field in C:\Users\marti\Desktop\Guaki\node_modules\realm\package.json)

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Nov 8, 2023
@CallumBrocklehurst
Copy link

CallumBrocklehurst commented Dec 11, 2023

I am getting this issue too while using WSL2 (or locally on windows)

@ozanicre
Copy link

Did anyone find the solution to this problem?

@kneth
Copy link
Contributor

kneth commented Feb 14, 2024

I am not sure if #6482 (comment) is relevant here

@sync-by-unito sync-by-unito bot added Waiting-For-Reporter Waiting for more information from the reporter before we can proceed and removed Needs-Attention Reporter has responded. Review comment. labels Feb 14, 2024
@nirinchev
Copy link
Member

Closing as stale.

@nirinchev nirinchev closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2024
@sync-by-unito sync-by-unito bot changed the title Realm package path . is not exported - expo Realm package path . is not exported - expo Mar 20, 2024
@sync-by-unito sync-by-unito bot reopened this Mar 20, 2024
@sync-by-unito sync-by-unito bot closed this as completed Mar 20, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
O-Community Waiting-For-Reporter Waiting for more information from the reporter before we can proceed
Projects
None yet
Development

No branches or pull requests

5 participants