question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New Project won't run since 1.0.0-rc.13

See original GitHub issue

Environment

macOS Mojave 10.14.4 node v8.15.0 yarn v1.13.0

Description

New project fails with this in the iOS Simulator:

Unhandled JS Exception: Attempted to assign to readonly property.


eval code
eval@[native code]
eval code
eval@[native code]
./node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:3528:5
__webpack_require__@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:724:34
fn@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:101:39

eval code
eval@[native code]
eval code
eval@[native code]
./node_modules/react-native/Libraries/BatchedBridge/BatchedBridge.js@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:3515:5
__webpack_require__@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:724:34
fn@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:101:39

eval code
eval@[native code]
eval code
eval@[native code]
./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:3541:5
__webpack_require__@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:724:34
fn@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:101:39

eval code
eval@[native code]
eval code
eval@[native code]
./node_modules/react-native/Libraries/Core/ReactNativeVersionCheck.js@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:4668:5
__webpack_require__@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:724:34
fn@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:101:39
eval code
eval@[native code]
eval code
eval@[native code]
./node_modules/react-native/Libraries/Core/checkNativeVersion.js@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:4694:5
__webpack_require__@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:724:34
fn@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:101:39

eval code
eval@[native code]
eval code
eval@[native code]
./node_modules/react-native/Libraries/Core/InitializeCore.js@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:4643:5
__webpack_require__@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:724:34
fn@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:101:39
eval code
eval@[native code]
http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:7590:5
__webpack_require__@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:724:34
http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:791:37
global code@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:792:12

./node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js
    index.bundle?platform=ios&dev=true&minify=false:3528:5
__webpack_require__
    index.bundle?platform=ios&dev=true&minify=false:724:34
fn
    index.bundle?platform=ios&dev=true&minify=false:101:39
./node_modules/react-native/Libraries/BatchedBridge/BatchedBridge.js
    index.bundle?platform=ios&dev=true&minify=false:3515:5
__webpack_require__
    index.bundle?platform=ios&dev=true&minify=false:724:34
fn
    index.bundle?platform=ios&dev=true&minify=false:101:39
./node_modules/react-native/Libraries/BatchedBridge/NativeModules.js
    index.bundle?platform=ios&dev=true&minify=false:3541:5
__webpack_require__
    index.bundle?platform=ios&dev=true&minify=false:724:34
fn
    index.bundle?platform=ios&dev=true&minify=false:101:39
./node_modules/react-native/Libraries/Core/ReactNativeVersionCheck.js
    index.bundle?platform=ios&dev=true&minify=false:4668:5
__webpack_require__
    index.bundle?platform=ios&dev=true&minify=false:724:34
fn
    index.bundle?platform=ios&dev=true&minify=false:101:39
./node_modules/react-native/Libraries/Core/checkNativeVersion.js
    index.bundle?platform=ios&dev=true&minify=false:4694:5
__webpack_require__
    index.bundle?platform=ios&dev=true&minify=false:724:34
fn
    index.bundle?platform=ios&dev=true&minify=false:101:39
./node_modules/react-native/Libraries/Core/InitializeCore.js
    index.bundle?platform=ios&dev=true&minify=false:4643:5
__webpack_require__
    index.bundle?platform=ios&dev=true&minify=false:724:34
fn
    index.bundle?platform=ios&dev=true&minify=false:101:39
__webpack_require__
    index.bundle?platform=ios&dev=true&minify=false:724:34
global code
    index.bundle?platform=ios&dev=true&minify=false:792:12

If Remote JS Debugging is on this is the error shown in the Simulator:

Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'

RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
UIApplicationMain
main
start

Seeing as 1.0.0-rc.12 works, the issue must be related to this commit as it’s the only change from 1.0.0-rc.12 to 1.0.0-rc.13: https://github.com/callstack/haul/commit/87ad54a1ba3d897cd80e4d425d2e962bbbdc6f81

Also when starting a new project the following errors occur but can be fixed by yarn add -D react-hot-loader react-dom (see also #532):

Module not found: Error: Can't resolve 'react-dom' in '.../MyProject/node_modules/haul/node_modules/react-hot-loader/dist' 
Module not found: Error: Can't resolve 'react-hot-loader' in '.../MyProject'

One more thing. I’m seeing these warnings repeated from the yarn haul start --platform ios command. I’ve no idea where these are coming from.

WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.

You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:

  npm install --save core-js@2    npm install --save core-js@3
  yarn add core-js@2              yarn add core-js@3

Reproducible Demo

Bootstrap new project:

react-native init MyProject
cd MyProject
yarn add -D haul
yarn haul init
yarn haul start -- --platform ios
react-native run-ios

Add missing packages:

yarn add -D react-hot-loader react-dom

Try again:

yarn haul start -- --platform ios
Unhandled JS Exception: Attempted to assign to readonly property.

package.json:

{
  "name": "MyProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest",
    "haul": "haul"
  },
  "dependencies": {
    "react": "16.8.3",
    "react-native": "0.59.4"
  },
  "devDependencies": {
    "@babel/core": "^7.4.3",
    "@babel/runtime": "^7.4.3",
    "babel-jest": "^24.7.1",
    "haul": "^1.0.0-rc.15",
    "jest": "^24.7.1",
    "metro-react-native-babel-preset": "^0.53.1",
    "react-dom": "^16.8.6",
    "react-hot-loader": "^4.8.4",
    "react-test-renderer": "16.8.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
kelsetcommented, May 9, 2019

two quick feedbacks:

  1. I also had to yarn add -D react-hot-loader react-dom to make Haul work (bug in way dependencies are set for Haul? not sure 🤔)
  2. Had to modify the haul config as wrote by @zamotany (thanks for sharing that btw!) - side question to that, can’t we modify the metro.config.js file instead? 🤔 I tried but couldn’t actually make it work tbh
Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio 2019 version 16.11 Release Notes
Get the latest features, bug fixes, and support for Visual Studio 2019 v16.11. Download today.
Read more >
Could not load file or assembly 'Microsoft.VisualStudio.Web ...
PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Read more >
'Failed to list versions for com.facebook.react:react-native ...
Description What went wrong: Could not determine the dependencies of task ':app:compileDebugKotlin'. Could not resolve all files for ...
Read more >
Unable to find expo in this project - have you run yarn / npm ...
enter image description here. Change expo version from "^1.0.0" to "~41.0.1" (package.json); npm install; npm start.
Read more >
Which Java SDK Should You Use? - Okta Developer
Oracle now distributes two JDK builds: Oracle JDK and Oracle OpenJDK. Oracle JDK is free for development and testing, but you have to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found