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

[0.54] Live Reload is broken on DeltaPatcher.js error #18209

Closed
fungilation opened this issue Mar 6, 2018 · 93 comments
Closed

[0.54] Live Reload is broken on DeltaPatcher.js error #18209

fungilation opened this issue Mar 6, 2018 · 93 comments
Labels
Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot.

Comments

@fungilation
Copy link

fungilation commented Mar 6, 2018

Environment

Environment:
  OS: macOS Sierra 10.12.6
  Node: 9.7.1
  Yarn: 1.5.1
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: Not Found

Packages: (wanted => installed)
  react: ^16.3.0-alpha.1 => 16.3.0-alpha.1
  react-native: 0.54.0 => 0.54.0

Expected Behavior

In debug mode with Live Reload on, code changes should trigger reloading of my RN app.

Actual Behavior

Doesn't trigger code changes since RN 0.54, it did before. Instead, code change stall on Chrome console error:

DeltaPatcher.js:58 Uncaught (in promise) Error: DeltaPatcher should receive a fresh Delta when being initialized
    at DeltaPatcher.applyDelta (DeltaPatcher.js:58)
    at deltaUrlToBlobUrl (deltaUrlToBlobUrl.js:34)
    at <anonymous>

screenshot 2018-03-05 13 54 50

Steps to Reproduce

Any RN 0.54 app should reproduce this. For reference, these are dependencies in my app package.json:

  "dependencies": {
    "babel-plugin-idx": "^2",
    "he": "^1.1.0",
    "lodash": "^4.17.2",
    "moment": "^2.19.0",
    "moment-timezone": "^0.5.10",
    "node-summary": "../node-summary",
    "react": "^16.3.0-alpha.1",
    "react-native": "0.54.0",
    "react-native-blur": "^3.2.0",
    "react-native-code-push": "^5.2.1",
    "react-native-easy-toast": "^1.0.9",
    "react-native-firebase": "^3.0",
    "react-native-fit-image": "^1.4.8",
    "react-native-highlight-words": "^1.0.1",
    "react-native-keep-awake": "^3.0.1",
    "react-native-linear-gradient": "^2.0.0",
    "react-native-modalbox": "^1.3.8",
    "react-native-orientation": "^3.1.3",
    "react-native-parallax-scroll-view": "../react-native-parallax-scroll-view",
    "react-native-safari-view": "^2.0.0",
    "react-native-sentry": "^0.34",
    "react-native-sha256": "^1.1.1",
    "react-native-status-bar-size": "^0.3.2",
    "react-native-swiper": "^1.5.10",
    "react-native-tooltip": "^5.2.0",
    "react-native-tts": "../react-native-tts",
    "react-native-vector-icons": "^4.1.1",
    "react-native-webview-bridge": "../react-native-webview-bridge-RN0.51",
    "react-redux": "^5.0.1",
    "redux": "^3.6.0",
    "redux-thunk": "^2.1.0"
  },
  "devDependencies": {
    "redux-logger": "^3.0.6"
  }
@sydneywu
Copy link

sydneywu commented Mar 6, 2018

Same issue. On every other refresh, this error message will appear. Using IOS simulator

@mjmasn
Copy link
Contributor

mjmasn commented Mar 6, 2018

Ditto but also without live reload, just pressing 'Reload' from the dev menu triggers the error about 70% of the time. Running Ubuntu 16.04, using a real device LG/Google Nexus 5X

Environment:
  OS: Linux 4.13
  Node: 8.9.4
  Yarn: 1.5.1
  npm: 5.6.0
  Watchman: Not Found
  Xcode: N/A
  Android Studio: Not Found

Packages: (wanted => installed)
  react: ^16.2.0 => 16.2.0
  react-native: ^0.54.0 => 0.54.0

EDIT: Even running react-native run-android again is giving the error unless I close the app each time 😞

@Gguigre
Copy link

Gguigre commented Mar 6, 2018

I got the same issue, hitting "Reload" several times seems to solve the problem (temporarly).
An other solution I found is to use React-Native-Debugger (https://github.com/jhen0409/react-native-debugger)

For an unknown reason, it seems to be working well

Good luck

@kelset kelset added the Tooling label Mar 6, 2018
@fungilation
Copy link
Author

fungilation commented Mar 6, 2018

I've been meaning to try React-Native-Debugger, but that doesn't resolve this issue.

@ropaillet
Copy link

Broken for now.. does it happen with emulator ?

@Gguigre
Copy link

Gguigre commented Mar 7, 2018

@fungilation yep, it's not a fix... Still, it solves the symptoms without curing the illness, better than nothing I suppose :/

@ropaillet Yep, I work with the IOS emulator and the problem is the same :/


)

@mgela
Copy link

mgela commented Mar 7, 2018

+1

@fungilation
Copy link
Author

Don't want to fork RN.

@iotriado
Copy link

iotriado commented Mar 7, 2018

Hi,
I face the same issue yesterday.
In my case the problem was that I was importing the same class twice:

import { ActivityIndicator, Dimensions, FlatList,ListView, ListItem ,Text, Image, View } from 'react-native';
import { List, ListItem } from "react-native-elements";

'ListItem' was imported twice.
By removing one instance , the problem solved.

@iotriado
Copy link

iotriado commented Mar 7, 2018

Actually I am wrong in my previous post , since this error is just blocking the 'real' backtrace to be shown.
Sorry for the inconvenience!!!
I follow the instructions above for remove the "throw" .
I have removed it from everywhere and the issue is not solved.
Do I have to rebuild smth?

@jqn
Copy link

jqn commented Mar 7, 2018

Same problem here with RN 0.54.0 on MacOS

@c--m
Copy link

c--m commented Mar 8, 2018

Same problem here with RN 0.54.0 on Windows

@wd
Copy link

wd commented Mar 8, 2018

I have downgrade to RN 0.52, I feel like 0.54 has lots of bugs, it's totally block our daily developing.

@fungilation
Copy link
Author

fungilation commented Mar 8, 2018

For me with WonderSwipe, I'm not seeing blockers other than this and this. Not enough to bother downgrading from 0.54 for me (yet)

@preetness
Copy link

I guess I wasn't the only one with this issue...

@karlmosenbacher
Copy link

@preetness, nope, having the same issue as everybody else 👯‍♂️

@alainib
Copy link

alainib commented Mar 9, 2018

following ( same issue on mac and android )

@yewenxiang23
Copy link

Same problem here

@yewenxiang23
Copy link

@Gguigre This has temporarily solved my problem.

@yewenxiang23
Copy link

@Gguigre Thank you very much

@Gguigre
Copy link

Gguigre commented Mar 9, 2018

@yewenxiang23 you're welcome ! Hoping that the issue will be solved soon, using react native debugger is not really a solution...

Maybe someones has an idea about why "classic debugger" does crash and react native debugger doesn't . It is based on the official Remote Debugger so I don't really understand what is different between those 2 ways of debugging...

@erick2014
Copy link

erick2014 commented Mar 9, 2018

Same error here
{
"name": "iosTestApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "^16.3.0-alpha.1",
"react-native": "0.54.0",
"react-native-background-timer": "^2.0.1",
"react-native-google-signin": "^0.12.0"
},
"devDependencies": {
"babel-jest": "22.4.1",
"babel-preset-react-native": "4.0.0",
"jest": "22.4.2",
"react-test-renderer": "^16.3.0-alpha.1"
},
"jest": {
"preset": "react-native"
}
}

I starts appearing when I do something like:

import BackgroundTimer from 'react-native-background-timer';

componentDidMount() {
    BackgroundTimer.start()
    this.interval = setInterval(() => {
      console.log('okay baby')
    }, 10000);
  }

  stopTimer = () => {
    clearInterval(this.interval);
    BackgroundTimer.stop()
  }

@fungilation
Copy link
Author

Can we get some acknowledgement from someone in the know that this issue is being looked at please? Based on commit history, @rafeca @sophiebits @adamjernst @cpojer

@xaphod
Copy link

xaphod commented Mar 9, 2018

My CMD & R keys are rapidly wearing out, would love to see this fixed. Annoying.
But I love me some devs, thanks for all you do ❤️

@rafeca
Copy link
Contributor

rafeca commented Mar 9, 2018

Sorry for the issue folks, this issue is fixed in metro v0.29.0

Seems that both RN 0.54 and 0.55 depend on metro v0.28.0, I think it should be safe to update them to use metro v0.29.0

In the meantim you can try forcing yarn to install metro v0.29.0 in your apps by using selective dependency resolutions.

@fungilation
Copy link
Author

Added this to my package.json:

  "resolutions": {
    "react-native/metro": "^0.29.0"
  },

and ran yarn install. No go on react-native run-ios. In the Metro Bundler terminal:

Scanning folders for symlinks in <app>/node_modules (62ms)

Cannot read property 'length' of undefined

Process terminated. Press <enter> to close the window

@xaphod
Copy link

xaphod commented Mar 9, 2018

@rafeca Yeah I get the same as @fungilation

@rafeca
Copy link
Contributor

rafeca commented Mar 9, 2018

ugh 😞 let me look into that

@ljanssen5
Copy link

@rafeca I still am receiving this after updating to RN 0.55.2 today. metro version is 0.30.2

@dougmbarcellos
Copy link

Same problem... RN 0.55.1, metro 0.30.2

@pouljohn1
Copy link

@rafeca same problem RN 0.55.2, metro 0.30.2

@rafeca
Copy link
Contributor

rafeca commented Apr 11, 2018

Thanks folks! I've tried to reproduce the issue in my RN test repo (https://github.com/rafeca/rn-test-app/) but I haven't been able. Which steps are you following/which error are you getting?

@pouljohn1
Copy link

@rafeca after yarn clean && rm -rf node_modules && yarn, killing packager, restarting google chrome it started to work flawlessly!

@rafeca
Copy link
Contributor

rafeca commented Apr 11, 2018

Thanks for the info! I think reloading the remote debugger tab in google chrome should be enough

@dougmbarcellos
Copy link

@paweljaneczek, I'll try this later.

@dougmbarcellos
Copy link

I tried the solution pointed out by @paweljaneczek, but it did not work. I did the same process, started Chrome again and also restarted OS

@dougmbarcellos
Copy link

dougmbarcellos commented Apr 16, 2018

My problem was with the Chrome version. It was in version 56, I upgraded to 65 and everything went well.

@xstable
Copy link

xstable commented Apr 17, 2018

I had the same Issue - even on react-native 0.55.2 and Metor 0.30.2.
I've removed all node_modules and install it again... once with yarn, once with npm. Same result.

I solved it now by manually remove the App from the Emulator (uninstall android-app via emulator-gui) and run the Packager again. Now it works.
Cost me several hours to figure out this. Hope this help someone too.

@iostate
Copy link

iostate commented Apr 24, 2018

Environment

OS: macOS High Sierra 10.13.2
Node: 9.8.0
Yarn: 1.3.2
npm: 5.6.0
Watchman: 4.9.0
XCode: 9.2 build (9C40b)
Android Studio: 3.0.1

Dependencies

"dependencies": {
"aws-amplify": "^0.3.0",
"aws-amplify-react-native": "^0.2.9",
"expo": "^26.0.0",
"react": "16.3.0-alpha.1",
"react-native": "0.54.0",
"react-navigation": "^1.5.11"
}

I experienced the same error while running my Android emulator. I noticed after enabling the "Debug JS Remotely" option in the Android Emulator menu, that I began to receive the error about every other manual reload, just as others have mentioned.

Solution: Disable remote debugging through the same menu.

Access the Android developer menu by pressing CMD-M while in the Android Emulator on Mac. Picture below of the culprit, see Debug JS Remotely option.

screen shot 2018-04-24 at 12 42 49 am

@mjstelly
Copy link

mjstelly commented May 7, 2018

@paweljaneczek fyi: yarn clean isn't a valid command. You may want to correct that in your post.

@mjstelly
Copy link

mjstelly commented May 7, 2018

@rafeca in which rn version is this supposedly fixed? I'm still running 0.54.1. It is still present in this version.

@rafeca
Copy link
Contributor

rafeca commented May 7, 2018

@mjstelly : this was fixed in v0.55.0

@mjstelly
Copy link

mjstelly commented May 7, 2018

@rafeca thanks. I'm upgrading and testing it now. 👍

@pstanton
Copy link

pstanton commented May 10, 2018

@rafeca @hramos I'm getting this in RN 0.55.4 !!

	"react": "^16.3.1",
	"react-native": "^0.55.4",
DeltaPatcher.js:58 Uncaught (in promise) Error: DeltaPatcher should receive a fresh Delta when being initialized
    at DeltaPatcher.applyDelta (DeltaPatcher.js:58)
    at deltaUrlToBlobUrl (deltaUrlToBlobUrl.js:34)
applyDelta @ DeltaPatcher.js:58
deltaUrlToBlobUrl @ deltaUrlToBlobUrl.js:34
async function (async)
ws.onmessage @ (index):155

@mjmasn
Copy link
Contributor

mjmasn commented May 10, 2018

@rafeca @hramos Same as @pstanton although we're still on 0.55.2, usually after a git checkout branch / rebuild, but at least now it only happens once per branch change, not on every reload. Workaround is force-closing the app then tapping the icon again, or failing that close everything and build again. Killing metro / running watchman watch-del-all / closing the chrome tab / uninstalling the app first has no effect on this.

Environment:
  OS: Linux 4.13
  Node: 8.9.4
  Yarn: 1.6.0
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: N/A
  Android Studio: Not Found

Packages: (wanted => installed)
  react: ^16.3.0 => 16.3.1
  react-native: ^0.55.2 => 0.55.2

@hramos
Copy link
Contributor

hramos commented May 10, 2018

Catching up on notifications just now. Surprised to see this thread on a closed + fixed issue. In the future, please do go ahead and open a new issue - that provides a higher signal (to me, at least) versus comments on issues that I've tagged as Fixed.

@fungilation
Copy link
Author

fungilation commented May 10, 2018

For this instance, can the Fixed flag be dropped on this issue? I don't see the issue myself personally (I'm on RN 0.54.4) but others are.

@pstanton
Copy link

@mjmasn FYI for me I just have to do another "refresh" .. this error occurs every 2nd refresh, ie after a successful one.

@hramos sorry I've had so many build issues this week i'm out of time! hopefully can just re-open this ticket?

@Noitidart
Copy link

I also have this issue intermittently on 0.55

@fungilation
Copy link
Author

Speaking of regressions, of what's been fixed in 0.54.4 but came back in 0.55. Should I make a new issue on this too? #18258 (comment)

@pstanton
Copy link

strangely, this has gone away but now "hot reloading" triggers but does nothing.

@ispadoto
Copy link

I'm seeing this error too...

"devDependencies": {
"babel-preset-react-native-stage-0": "^1.0.1",
"jest": "^22.4.3",
"jest-react-native": "^18.0.0",
"react-test-renderer": "16.3.1"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"test": "jest"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"native-base": "^2.4.4",
"react": "16.3.1",
"react-native": "^0.55.4",
"react-native-navigation": "^1.1.458",
"react-native-vector-icons": "^4.6.0",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"remote-redux-devtools": "^0.5.12"
}

@M4rcDev
Copy link

M4rcDev commented May 14, 2018

Got the same problem...

    "react": "^16.3.0",
    "react-native": "0.54.0",

Edit: Got it working, I had to reload the debugging page in google chrome

@WilliamAnputra
Copy link

WilliamAnputra commented Jun 19, 2018

@TheNuclearCat wasted 15 minutes just to figure this out.

[Update 01 -July-2018 ] i got the same error again today, what i did was

  1. yarn autoclean
  2. rm -rf node_modules
  3. yarn
  4. restart packager & run react-native run-android

all good now.

"react": "^16.3.1",
"react-native": "^0.55.4",

@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests