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

Unable to resolve module buffer in react-native #102

Open
astrahov opened this issue Sep 24, 2020 · 2 comments
Open

Unable to resolve module buffer in react-native #102

astrahov opened this issue Sep 24, 2020 · 2 comments

Comments

@astrahov
Copy link

Packages

  • react-native: 0.63.2
  • serialize-javascript: 3.1.0 and higher (3.1.0 - 5.1.0)

Use

import serialize from 'serialize-javascript'

...

const var1 = serialize(value)

Error
The application crashes on startup with an error:
Unable to resolve module buffer from node_modules/safe-buffer/index.js: buffer could not be found within the project

Found a solution (in App.js):
npm install -S buffer

import { Buffer } from 'buffer';
global.Buffer = Buffer; // very important

But that doesn't work either and throws another error:

  • ERROR Error: Secure random number generation is not supported by this browser.
    Use Chrome, Firefox or Internet Explorer 11
  • ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
@astrahov
Copy link
Author

astrahov commented Nov 1, 2021

Packages

  • react-native: 0.66.1
  • serialize-javascript: 3.1.0 and higher (3.1.0 - 6.0.0)

There is still a problem

@cx690
Copy link

cx690 commented Nov 25, 2021

Maybe the same problem:#134

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

No branches or pull requests

2 participants