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

React native SDK error: While trying to resolve module idb-keyval from file #1441

Closed
4 tasks done
zealmurapa opened this issue Jan 12, 2022 · 10 comments
Closed
4 tasks done
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@zealmurapa
Copy link

zealmurapa commented Jan 12, 2022

New Issue Checklist

Issue Description

I am suddenly getting an error with the new release of parse and including the old ones too regarding idb-keyval. I see that the latest release sought to address that bug, however it doesn't seem to go away.

Steps to reproduce

import Server from "parse/react-native.js";
import AsyncStorage from '@react-native-async-storage/async-storage';

Server.setAsyncStorage(AsyncStorage);
Server.initialize(Constants.APP_ID, Constants.JAVASCRIPT_KEY);
Server.serverURL = Constants.APP_API;

then try run the app in the emulator

Actual Outcome

Check the logs below

Expected Outcome

that the react native build should run as usual following: (import Server from "parse/react-native.js";)

Environment

Node JS 12 on Mac iOS Big sur

Server

  • Parse Server version: 5.0.0-beta.4
  • Operating system: Mac OS
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 4.2
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): MongoDB Atlas

Client

  • Parse JS SDK version: 3.4.1

Logs

iOS Bundling failed 10162ms
While trying to resolve module idb-keyval from file /node_modules/parse/lib/react-native/IndexedDBStorageController.js, the package /node_modules/idb-keyval/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/node_modules/idb-keyval/dist/compat.cjs. Indeed, none of these files exist:

  • /node_modules/idb-keyval/dist/compat.cjs(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)
  • /node_modules/idb-keyval/dist/compat.cjs/index(.native|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx|.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json)
@parse-github-assistant
Copy link

parse-github-assistant bot commented Jan 12, 2022

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@mtrezza
Copy link
Member

mtrezza commented Jan 13, 2022

Does this issue belong to https://github.com/parse-community/parse-react?

@zealmurapa
Copy link
Author

Does this issue belong to https://github.com/parse-community/parse-react?

parse/react-native.js is a under parse sdk

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Jan 13, 2022
@stage88
Copy link

stage88 commented Jan 16, 2022

I got this same issue since upgrading to 3.4.1, its only a problem when used in a react-native project.

@mtrezza
Copy link
Member

mtrezza commented Jan 16, 2022

The changelog says:

dist no longer committed.

Maybe that explains the error log:

However, this package itself specifies a main module field that could not be resolved (/node_modules/idb-keyval/dist/compat.cjs. Indeed, none of these files exist:

See this change and the readme.

@chillaxdev
Copy link

chillaxdev commented Jan 16, 2022

@zealmurapa I got the same issue recently and have fixed it using this.
facebook/metro#535 (comment)

If it worked, it should bring you a new error "Can't find variable: indexedDB", which I've opened here.

@ndukachukz
Copy link

ndukachukz commented Jan 18, 2022

I am having the same error with expo & typescript and I have no metro config. Do I create a metro.config.ts file or .js file then add support for .cjs and .mjs?

@ndukachukz
Copy link

@zealmurapa I got the same issue recently and have fixed it using this. facebook/metro#535 (comment)

If it worked, it should bring you a new error "Can't find variable: indexedDB", which I've opened here.

Have you been able to fix this? I'm having the same errors

@anhtuank7c
Copy link

@ndukachukz I having the same issue.
Best solution at this time is to use Parse version 3.4.0

@dplewis
Copy link
Member

dplewis commented Jan 27, 2023

Closing via #1569

@dplewis dplewis closed this as completed Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

7 participants