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

Cmd-R not refreshing? #306

Closed
tehfailsafe opened this issue Mar 27, 2015 · 49 comments
Closed

Cmd-R not refreshing? #306

tehfailsafe opened this issue Mar 27, 2015 · 49 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@tehfailsafe
Copy link
Contributor

Everything loads up fine, example are are running smoothly, but if I make a change in the JS file and hit Cmd-R in the simulator, nothing happens. Did I forget something?

xcode - Version 6.2 (6C131e)
simulator - Version 8.2 (553.8
watchman - 3.0.0
node - 0.12.1

@tischler
Copy link

+1 -- I've even deleted the folder, re-created a new folder, run the app, and I'm still seeing my changes from before the delete.

xcode - Version 6.2 (6C131e)
yosemite - 10.10.1
node 0.12.0

@amasad
Copy link
Contributor

amasad commented Mar 27, 2015

Can you try restarting your computer? The FileWatcher might be in a bad state

@tehfailsafe
Copy link
Contributor Author

I restarted a few times, uninstalled/reinstalled node and watcher, and now reinstalling xcode.

@meetwudi
Copy link
Contributor

It works fine for me. Make sure to use the latest stable version of XCode, and install XCode Command Line Tools.

@tehfailsafe
Copy link
Contributor Author

Installing xcode from the app store, should I grab a different one?

@amasad
Copy link
Contributor

amasad commented Mar 27, 2015

I doubt Xcode is the problem here. If the app opens in the simulator and renders it's probably something in the packager. This is a long shot but maybe the packager is run in in the wrong directory. Can you go to the directory you're changing and manually start the packager? You can use react-native start

@tehfailsafe
Copy link
Contributor Author

I was running npm start from react-native root, but even starting it deeper in still pacakages from the main directory.

> react-native@0.2.1 start /Users/me/react/react-native
> ./packager/packager.sh

@tehfailsafe
Copy link
Contributor Author

Also watching some others on youtube and it seems there's a blink or flash in the simulator on the reload. When I hit Cmd-R there's no blink or anything, nothing happens at all.

@amasad
Copy link
Contributor

amasad commented Mar 27, 2015

Are there any logs in your terminal? It should say something about the
requests and time taken.

If there aren't any then there might be something wrong with the Cmd r
itself

On Thursday, March 26, 2015, tehfailsafe notifications@github.com wrote:

Also watching some others on youtube and it seems there's a blink or flash
in the simulator on the reload. When I hit Cmd-R there's no blink or
anything, nothing happens at all.


Reply to this email directly or view it on GitHub
#306 (comment)
.

@tehfailsafe
Copy link
Contributor Author

When I make a change in the editor I see this in the terminal:

[21:46:15] <START> find dependencies
[21:46:15] <END>   find dependencies(5ms)
[21:46:15] <START> transform
[21:46:15] <END>   transform(189ms)

But that is when I save from the editor, before attempting to hit Cmd-R

@tehfailsafe
Copy link
Contributor Author

hitting Cmd-R in the simulator produces no logs in the terminal or in xcode console.

@montogeek
Copy link

You have to hit Cmd+R twice, every time :)

@tehfailsafe
Copy link
Contributor Author

I am spamming it 50 times, doubt that's the problem... :)

@tehfailsafe
Copy link
Contributor Author

Fun note, learned from @jordwalke on twitter to use the shake gesture to bring up the dev dialog, and reloading from there works great. Also enabling live reload now works by just saving the JS file without touching Cmd-R.

@tehfailsafe
Copy link
Contributor Author

Turns out it's a simple hardware keyboard setting in the simulator menu. Never would have thought to check that, especially since things like alt-drag work for multi-touch emulation without this setting enabled.

image

@sahrens
Copy link
Contributor

sahrens commented Mar 27, 2015

Glad you could figure it out. What to send a PR with the tip?

On Mar 26, 2015, at 10:41 PM, tehfailsafe notifications@github.com wrote:

Turns out it's a simple hardware keyboard setting in the simulator menu. Never would have thought to check that, especially since things like alt-drag work for multi-touch emulation without this setting enabled.


Reply to this email directly or view it on GitHub.

@tehfailsafe
Copy link
Contributor Author

Sure first thing in the morning!
On Thu, Mar 26, 2015 at 10:45 PM Spencer Ahrens notifications@github.com
wrote:

Glad you could figure it out. What to send a PR with the tip?

On Mar 26, 2015, at 10:41 PM, tehfailsafe notifications@github.com
wrote:

Turns out it's a simple hardware keyboard setting in the simulator menu.
Never would have thought to check that, especially since things like
alt-drag work for multi-touch emulation without this setting enabled.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#306 (comment)
.

@imWildCat
Copy link

@tehfailsafe Fixed, thanks!

This was referenced Mar 27, 2015
tehfailsafe added a commit to tehfailsafe/react-native that referenced this issue Mar 27, 2015
@vjeux
Copy link
Contributor

vjeux commented Mar 27, 2015

#326 is related. If you don't have a qwerty/azerty keyboard layout, it won't work

tehfailsafe added a commit to tehfailsafe/react-native that referenced this issue Mar 27, 2015
Hopefully alleviates new issues getting created for similar problems. 
Addresses facebook#257 facebook#304 facebook#306 facebook#326
@rywhee
Copy link

rywhee commented Mar 28, 2015

Unfortunately, the keyboard toggle does not fix the issue for me. Have tried that as well as uninstalls and reboots. Two near identical machines:

Yosemite 10.10.2
Xcode 6.2
iOS Simulator 8.2
node v0.12.1

First run of the project:

[12:26:54 AM] <START> request:/index.ios.bundle
[12:26:54 AM] <START> find dependencies
[12:27:00 AM] <END>   find dependencies(6496ms)
[12:27:00 AM] <START> transform
[12:27:00 AM] <END>   transform(202ms)

Cmd-R (2x) in the simulator causes a screen flash, as if a reload is happening; but new content is not pulled in.

@amasad
Copy link
Contributor

amasad commented Mar 28, 2015

@rywhee no <END> request:/index.ios.bundle event?

@rywhee
Copy link

rywhee commented Mar 28, 2015

@amasad my bad, I snipped it!

[12:39:38 AM] <START> request:/index.ios.bundle
[12:39:38 AM] <START> find dependencies
[12:39:44 AM] <END>   find dependencies(5888ms)
[12:39:44 AM] <START> transform
[12:39:45 AM] <END>   transform(234ms)
[12:39:45 AM] <END>   request:/index.ios.bundle(6140ms)

@amasad
Copy link
Contributor

amasad commented Mar 28, 2015

So it seems like the simulator is requesting the package and receiving it. Maybe the packager isn't picking up your changes. Try stopping the packager and starting it manually via react-native start in your project dir.

@rywhee
Copy link

rywhee commented Mar 28, 2015

Thanks @amasad. Unfortunately, a manual start does not resolve the issue for me.

FYI - I have had to bump MAX_WAIT_TIME in FileWatcher to avoid the 'Watcher took too long to load' error...

@amasad
Copy link
Contributor

amasad commented Mar 28, 2015

Does it at least pick up changes between stopping and starting the packager? (Trying to make sure it's not a file watcher issue)

@rywhee
Copy link

rywhee commented Mar 28, 2015

@amasad yep, when stopping then re-starting the packager; changes are picked up fine. It's just the live reload that's not happening.

@jordanfloyd
Copy link

@rywhee are you using sublime text 3? I had to disable atomic save for refresh to work properly.

@rywhee
Copy link

rywhee commented Mar 29, 2015

My issue refresh issue was related to watchman permissions.... solved here

facebook/watchman#90

@vjeux
Copy link
Contributor

vjeux commented Apr 1, 2015

Closing this issue for now since it seems resolved, please re-open if you face it again

@vjeux vjeux closed this as completed Apr 1, 2015
@amasad
Copy link
Contributor

amasad commented Apr 1, 2015

If you have time please update the troubleshooting page with the your workarounds/fixes.

@tehfailsafe
Copy link
Contributor Author

updated to add the watchman permissions fix.
#585

@eyaleizenberg
Copy link

@rywhee Thanks dude! Solved all my issues!

@rywhee
Copy link

rywhee commented Jul 14, 2015

@eyaleizenberg 👍 - happy coding!

@siemiatj
Copy link

In case somebody is using Dvorak layout, you need to refresh with Cmd+P.

@poberwong
Copy link

Maybe it's just caused by the different build mode,you need to change the build mode into debug if it is release mode currently. command+R and command+D is the special key combination while you debug the program with simulator....the concrete step is : [In Xcode 6 & 7] Choose Product -> Scheme -> Edit Scheme. Change the Build Configuration under the Info tab.
hope that it will work for you

@dvisco
Copy link

dvisco commented Mar 2, 2016

@bob1993 many thanks, was as simple as such!

@poberwong
Copy link

@dvisco It's my pleasure ~

@sashafklein
Copy link

@bob1993 Ditto -- forgot I had to change the scheme back to debug!

@poberwong
Copy link

@sashafklein Hahahaha...

@JakeLin
Copy link

JakeLin commented Mar 20, 2016

@tehfailsafe save my life. 👍 I added a reaction to make sure the others can see it.

@xcchcaptain
Copy link

@jordanfloyd thanks ,solved my problem
does that mean autosave will disable live loading ?

@devyu
Copy link

devyu commented May 2, 2016

@tehfailsafe thanks, it is work!

@zire
Copy link

zire commented Aug 4, 2016

@bob1993 Thank you so much! Yes changing the mode to Debug fixed this refresh issue for me.

@JJMoon
Copy link

JJMoon commented Dec 6, 2016

I have this issue.
Mac os : Sierra.
watchman : 4.7.0
react-native : 0.38.1
react-native-cli: 1.2.0
xcode : 8.1
I did watchman install --HEAD ... not work..

Solved.. with one line of command.. But, I did some other stuffs, so I am not sure this is the only source.

rm -rf /usr/local/var/run/watchman/ && brew uninstall watchman && brew install watchman

@ngothanhtai
Copy link

Quit the simulator and start again. Works for me.

@struggle-fish
Copy link

image

@luizdias
Copy link

In my case I could only get cmd+R working after disabling "Send Menu Shortcuts to Device":

captura de tela 2018-02-25 as 00 24 59

@yanush
Copy link

yanush commented Mar 3, 2018

in my case my build configuration was set to release. changing it to debug solved the problem

@aloifolia
Copy link

aloifolia commented May 4, 2018

For me, a restart of the simulator worked: "Hardware" -> "Restart"

@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 23, 2018
jfrolich pushed a commit to jfrolich/react-native that referenced this issue Apr 22, 2020
Closes facebook#306 if we think that's the right decision to remove it until that's really supported.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests