-
Notifications
You must be signed in to change notification settings - Fork 161
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
Fastboot does not respect rootElement
#206
Comments
@Gaurav0 The server-rendered HTML should be removed by https://github.com/ember-fastboot/ember-cli-fastboot/blob/master/app/instance-initializers/browser/clear-double-boot.js#L19. Can you investigate why that line is not working? |
I found a workaround where I put |
@tomdale I just ran into this issue, @Gaurav0's fix worked for me too. Seems like FastBoot renders to the |
@steveszc I agree that would be ideal. The tricky thing about this is we treat all of the HTML at render time as static strings, and the I would be open to a PR that adds this feature, so long as it could be done without a noticeable performance penalty. |
We encountered this on the ember-builds app from the learning team and I could reproduce the same on a fresh app with FastBoot. The workaround mentioned here on moving the content for body inside the root element works as well. |
@sivakumar-kailasam Just to make sure, the issue doesn't occur out-of-the-box, right? It requires setting a custom The problems I outlined in #206 (comment) still exist, I think the best we could do from a user experience perspective is do a check in JavaScript to verify that the |
I think this would be a good issue for new contributors. In the code in https://github.com/ember-fastboot/ember-cli-fastboot/blob/master/app/instance-initializers/clear-double-boot.js, it should be straightforward to detect whether the server-rendered root element was found, and if not, issue a warning or error. |
@tomdale I was under the impression from your earlier comment that rootElement could be a jQuery selector. Is there a way to handle that in node? |
@tomdale yes, it happens only in cases where rootElement is set. I added the comment since there was a needs reproduction label on the issue 😅 |
I'm strangely seeing the double render suddenly in the opposite case, where the rootElement is not set...and if I set it to an arbitrary value, the double rendering stops 😶 I noticed in my package.lock that ember-cli-fastboot had upgraded automatically during my last npm install from
Changing my package.json for ember-cli-fastboot to stay at |
- Improve post-section styles - Lock ember-cli-fastboot dependency to 1.1.1 to solve double rendering bug (see ember-fastboot/ember-cli-fastboot#206) - Auto-generate grunt-hoist npm scripts - Update package-lock.json
Is this fixed as of this commit since it clears out everything in the |
Update minimum version of simple-dom to 1.4.0.
If
rootElement
is defined in an application, both the fastboot HTML and the Ember DOM are rendered.The text was updated successfully, but these errors were encountered: