Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

[email protected] not working with TransferStateModule #832

Closed
naveedahmed1 opened this issue Oct 24, 2017 · 8 comments
Closed

[email protected] not working with TransferStateModule #832

naveedahmed1 opened this issue Oct 24, 2017 · 8 comments

Comments

@naveedahmed1
Copy link

  • I'm submitting a ...
- [ x] bug report
- [ ] feature request
- [ ] support request => Please do not submit support request here, see note at the top of this template.
  • What modules are related to this Issue?
- [x ] aspnetcore-engine
- [ ] express-engine
- [ ] hapi-engine
  • Do you want to request a feature or report a bug?
    It seems to be a bug.

After upgrading to [email protected] I tried adding ServerTransferStateModule and BrowserTransferStateModule from @angular/platform-server' and @angular/platform-browser respectively. As suggested https://next.angular.io/api/platform-server/ServerTransferStateModule and https://medium.com/@evertonrobertoauler/angular-5-universal-with-transfer-state-using-angular-cli-19fe1e1d352c

But after this change, I am now receiving error Error: The selector "app-root" did not match any elements and no markup is generated at server.

  • Please tell us about your environment:
  • Angular version: 5.0.0-rc.1
  • Browser: [Chrome]
  • Language: [TypeScript]
  • OS: [Windows]
  • Platform: [.NETCore]
@vikerman
Copy link
Contributor

@MarkPieszak - Looks like the DOM nodes added by TransferState is affecting the ASP.NET engine parsing?

@naveedahmed1
Copy link
Author

naveedahmed1 commented Oct 31, 2017

@MarkPieszak I think with new ASP.Net engine the old TransferStateModule approach that we followed in https://github.com/MarkPieszak/aspnetcore-angular2-universal is also broken transferData is always empty as a result the http requests are being executed twice. Can this please be fixed any time soon?

@naveedahmed1
Copy link
Author

Any update on this? Seems like I am the only person using this engine :D

@daveriedstra
Copy link

we're using it too, @naveedahmed1, and looking forward to an update

@naveedahmed1
Copy link
Author

@daveriedstra try new upcoming template from asp.net team you wont be disappointed aspnet/JavaScriptServices#1288 (comment)

I think Universal team will ultimately retire aspnetcore-engine after the new template is release.

@devel112
Copy link

devel112 commented Jan 5, 2018

aspnetcore-engine is taking elements out of the document (style, scripts, links) so that .NET can paste the elements where it wishes, the problem is that it's only getting scripts from head, and servertransfersatemodule is appending it's state script to body.

Is it that wise to rip appart the dom and recreating it in .NET? From this example it seems risky.
If i'm not wrong this was done because of better SEO, but couldn't atleast renderModuleFactory give back SEO friendly (i mean, the function is created by Google afterall 😸) html?

@devel112
Copy link

Fixed in #889

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants