Skip to content

Unable to resolve module crypto #138

@Hyllesen

Description

@Hyllesen

With a fresh install of React Native 0.83 and Parse 8 I get this error message:

Unable to resolve module crypto from /Users/stefan/appname/node_modules/parse/lib/react-native/uuid.js: crypto could not be found within the project or in these directories:
  node_modules/parse/node_modules
  node_modules
  3 | });
  4 | exports.default = void 0;
> 5 | var uuid = require('crypto').randomUUID;
    |                     ^
  6 | var _default = exports.default = uuid;

RCTFatal
__40-[RCTInstance handleBundleLoadingError:]_block_invoke
__RCTExecuteOnMainQueue_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_drain.cold.7
_dispatch_main_queue_drain
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
_CFRunLoopRunSpecificWithOptions
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
block_destroy_helper.15
$sSo21UIApplicationDelegateP5UIKitE4mainyyFZ
$s13BumpSugar202611AppDelegateC5$mainyyFZ
__debug_main_executable_dylib_entry_point
start_sim
0x0

The code is simply importing Parse:

const Parse = require('parse/react-native.js');

// On React Native >= 0.50 and Parse >= 1.11.0, set the Async
const AsyncStorage = require('@react-native-async-storage/async-storage');
Parse.setAsyncStorage(AsyncStorage);
import { View } from 'react-native';

function App() {
  return <View></View>;
}

export default App;

my package.json

    "parse": "^8.0.2",
    "react-native": "0.83.1",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions