I first noticed an issue when my builds suddenly started to take ~30s. When I run ember s, changes to project files properly trigger a rebuild, but changes aren't visible in the browser. We have livereload disabled, but manual reloads still don't reflect changes. In an effort to isolate the issue, I created a brand new ember app completely separate from our code base and the issue is reproduced.
ember new foo
cd foo
ember s
I open the app in Chrome at http://localhost:4200 to be welcomed by Ember. I then make a change to templates/application.hbs. The server does a rebuild, though oddly slow at ~4s.
file changed templates\application.hbs
Build successful - 4106ms.
Slowest Trees | Total
----------------------------------------------+---------------------
TreeMerger (stylesAndVendor) | 245ms
Funnel: Funnel (bower) | 238ms
Slowest Trees (cumulative) | Total (avg)
----------------------------------------------+---------------------
TreeMerger (stylesAndVendor) (1) | 245ms
BroccoliMergeTrees (4) | 242ms (60 ms)
Funnel: Funnel (bower) (1) | 238ms
Babel (12) | 238ms (19 ms)
Chrome doesn't refresh the page as I would expect with livereload. A manual refresh doesn't help either. If I look in dist, assets/foo.js's template code doesn't reflect my change either. I'm not sure if I should expect a change here; I feel as though this is telling or completely irrelevant.
D:\code\src\VConsole\EmberConsole> ember -v
version: 2.3.0
node: 5.10.1
os: win32 x64
It's worth noting I've been working in this environment for about a year now. Our app used to build in under 1s and all was smooth. This started late last week. It's obvious something has changed but I have no idea what it could be anymore. Let me know any additional environment details I can provide.
@aluink could you retry this with our latest stable release (2.4.3)?
@Turbo87 OK, I upgraded to 2.4.3 and livereload now works in the new app. My build times are still very long. Still around ~4s for the new app and the following for our main project. ~41s on initial and ~22s for incremental.
Build successful - 41469ms.
Slowest Trees | Total
----------------------------------------------+---------------------
Babel | 7578ms
Babel | 4162ms
Slowest Trees (cumulative) | Total (avg)
----------------------------------------------+---------------------
Babel (32) | 17134ms (535 ms)
file changed templates\styleguide.hbs
file changed templates\styleguide.hbs
Build successful - 22880ms.
Slowest Trees | Total
----------------------------------------------+---------------------
Funnel: Funnel (bower) | 1406ms
TreeMerger (appJS & processedEmberCLITree) | 1167ms
Slowest Trees (cumulative) | Total (avg)
----------------------------------------------+---------------------
Funnel (16) | 1650ms (103 ms)
Funnel: Funnel (bower) (1) | 1406ms
BroccoliMergeTrees (11) | 1242ms (112 ms)
TreeMerger (appJS & processedEmberCLI... (1) | 1167ms
The new app reflects changes via livereload. Our main project doesn't reflect incremental changes despite manual browser refreshes.
did you update ember-cli in you main project too?
Oh right, here are new build times for my main project on 2.4.3.
Build successful - 15574ms.
Slowest Trees | Total
----------------------------------------------+---------------------
TreeMerger (stylesAndVendor) | 904ms
TreeMerger (appJS & processedEmberCLITree) | 871ms
TreeMerger (appAndDependencies) | 836ms
Slowest Trees (cumulative) | Total (avg)
----------------------------------------------+---------------------
Babel (30) | 1226ms (40 ms)
BroccoliMergeTrees (7) | 1017ms (145 ms)
TreeMerger (stylesAndVendor) (1) | 904ms
TreeMerger (appJS & processedEmberCLI... (1) | 871ms
TreeMerger (appAndDependencies) (1) | 836ms
file changed controllers\styleguide.js
Build successful - 14842ms.
Slowest Trees (cumulative) | Total (avg)
----------------------------------------------+---------------------
Funnel (10) | 788ms (78 ms)
Babel (30) | 773ms (25 ms)
BroccoliMergeTrees (7) | 758ms (108 ms)
@aluink so that live reload issue is solved now by upgrading?
Yes, livereload works for the new app. Since we don't use it for our main project, that's secondary. The primary issue is the long build times and ember serve not properly updating the assets after incremental builds.
and ember serve not properly updating the assets after incremental builds
that's what I was asking about. that still doesn't work even after updating ember-cli?
Correct. It still doesn't work after updating. ember serve is not updating my assets on incremental builds.
We have livereload disabled
how did you disable it? can you reproduce this in a fresh project?
We didn't disable it, we just don't use it.
We have a .NET app that has an Ember app run inside it; we're transitioning from ASP. We created an in-house addon that copies the assets into our .NET app for it, .NET, to serve. Since the assets aren't updated after incremental builds, our app doesn't get the code changes. Moreover, 18-25s build times are a huge time sink from the <1s they used to be.
Another things to note is we have 3 separate Ember apps we serve this way. I've only coded in one of them, ever, yet this issue exists in all 3 for me. My team members don't have this problem at all. This leads me to think it's not a code or ember-cli issue, but something wrong with my environment.
What else could cause my build times to be so slow? Let's keep my project out of this for now, even the basic start app out of ember new builds abnormally slow. Here's a list of things I've ruled out.
@aluink we should keep the focus on your live reload problem as that is the title of this issue. if you have performance problems too please read https://github.com/ember-cli/ember-cli/blob/master/PERF_GUIDE.md and if that didn't help open another issue that is just focused on the performance issues.
OK, I may have to open another issue regarding the perf issues.
On the reload, should ember server update assets when a rebuild it triggered?
AFAIK yes, it should update the assets, otherwise it wouldn't be able to serve them. is is possible that your sync script isn't picking up the changes?
OK, that's what I thought. And therein lies the problem, the assets folder isn't updating; I've watched it.
please try to reproduce this issue somehow in an example project somewhere otherwise we have no chance of solving this
Alright, earlier yesterday it seems as though updating to ember-cli 2.4.3 solved the livereload issue for a brand new ember app. I created a new one today and livereload doesn't work for it.
ember new foo
cd foo
ember s
D:\code\foo> npm version
{ foo: '0.0.0',
npm: '3.8.3',
ares: '1.10.1-DEV',
http_parser: '2.6.2',
icu: '56.1',
modules: '47',
node: '5.10.1',
openssl: '1.0.2g',
uv: '1.8.0',
v8: '4.6.85.31',
zlib: '1.2.8' }
I've just tried this in a Windows VM and could not reproduce your issue. It takes quite a bit longer to compile in the VM but once done live reloads seems to work as expected.
Right, that's expected. I have no idea what to look at that would cause this. ember build works, but every build after the initial build of ember serve fail to update the assets and therefore fails to livereload.
as you are using windows, have you throughly reviewed http://ember-cli.com/user-guide/#windows?
Yeah, we did this way back when we started our Ember work a year ago or so. I've doubled checked everything again when this issue started up last week to make sure things didn't revert on me.
Anyways, as the label suggests we require a reproduction to move forward.
I understand. Given this is so unexpected there's clearly something outside of ember that's causing this and I have no idea what to look for anymore.
@aluink
some things:
I dealt with the first 2 long ago by creating an exclusion in my AVS and my editor, Sublime, opens app/. We don't use Dropbox, a USB drive, or software disk encryption.
Here's what happened last week when I started having this problem. I started working on this addon. I cloned it and added it into my project. At first I figured it was the addon, so I removed it. That didn't help. So I blew away my entire project repo and recloned it from upstream. Being in a state from before I ever brought ember-freestyle to the scene, I figured it would remove whatever happened. Nope, it lingers. I've since also reinstalled all of npm.
At this point I'm thinking there's something, probably trivial, outside of the usual Windows suspects giving me all this grief.
hmm, I'm curious what that might be. Unfortunately, I'm not sure what we can do on our end without a reproduction.
@felixrieseberg anything come to mind?
Right, I understand the lack of things you can do. I'm just hoping someone might have a bright idea. My next step at this point if nothing comes up is to rebuild my entire box :/
Right, I understand the lack of things you can do. I'm just hoping someone might have a bright idea. My next step at this point if nothing comes up is to rebuild my entire box :/
someone else recently mentioned this, and it seems to have addressed the issue. But a pretty lame work-around... I would love to figure out the root cause.
Agreed. I just had a co-worker come log into my box with their account and they were able to build with no performance or livereload issues. So the box itself is OK, I think we've narrowed it to my account on the box.
Alright, we got it. Not sure exactly what the issue was, but we downloaded ccleaner and cleaned. Didn't target anything out of the ordinary. The only interesting, though arguably unrelated, was my recycle bin had 10G. Other than that it was just browser caches and temp files. idk... I'll close this and thank both of you, @stefanpenner and @Turbo87, for your help and patience.
...back to work I go :)
It may be worth mentioning ccleaner, or another preferred tool, for other people having similar performance/IO/Windows type of issues.
@aluink mind adding a blurb to: https://github.com/ember-cli/ember-cli.github.io/blob/master/_posts/2013-04-02-practices-windows.md ?
Sure, I'd love to!
I ran into this same thing today. Tried all the recommendations I could find. Styles reloaded fine, js changes reloaded fine. But hbs changes wouldn't do anything, even on a manual refresh of the browser. Had to restart ember to see changes.
I downloaded and ran ccleaner. Restarted ember one last time. All changes now reload as expected.
Weird, but glad I could find this report.
I downloaded and ran ccleaner. Restarted ember one last time. All changes now reload as expected.
:+1: