angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Googlebot fails to render app (used to work without server rendering). SEO.

Open Judp0m opened this issue 9 years ago • 11 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report
- [ ] feature request

This is to report a regression: An app produced by angular-cli used to be properly rendered by googlebot (without any server rendering involved, I have snapshots in the google search console properly rendering my landing page, from a month ago). It now fails on my app, and on a fresh starter app from angular-cli 1.0. It only shows "Loading...", i.e. the content of but fails at bootstrapping the app. app works! gets properly displayed on the real website but not by googlebot.

I am building the app with the following flags: ng build --prod --aot --no-sourcemap

Versions.

@angular/cli: 1.0.0
node: 6.9.5
os: linux x64
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/core: 4.0.1
@angular/forms: 4.0.1
@angular/http: 4.0.1
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1
@angular/router: 4.0.1
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.1

OS: Linux, Ubuntu 16.04

Repro steps.

Pull latest angular-cli, build, and deploy to app-engine

Test page via Google's speed test / mobile friendly tools:

  1. https://developers.google.com/speed/pagespeed/ or
  2. https://search.google.com/search-console/mobile-friendly

Judp0m avatar Mar 31 '17 06:03 Judp0m

this is interesting .. I used to have the opposite problem. All my apps since beta.31 always rendered only loading... However, after upgrading to 1.0.0 and enabling gzip compression I started to see snapshots of my app. I didn't think was related to the app itself but rather the gzip might have boosted load speed.

dave11mj avatar Mar 31 '17 14:03 dave11mj

The basic "App works" App is so small and fast to load with --aot that I doubt it is related to the load speed.

In the Google search console, I have snapshots from January where it properly bootstrapped the app. It regressed sometimes during February.

What flags do you use with 'ng build'?

Judp0m avatar Mar 31 '17 16:03 Judp0m

I use --prod which should already include the --aot .. Thats why in my case I didn't see the "loading.." as a bug when I first started since that is technically what view source is.. I was mostly amused / surprised to see a full snapshot after I enabled gzip .. so I thought it was gzip in my case what enhanced my application. It'd be good to know if there is an official support / expected behavior for Angular 2 snapshots.

dave11mj avatar Mar 31 '17 16:03 dave11mj

same here, used to work before uploading to angular 4 It's quite critical now that google is not rendering my site...

Perezmarc avatar Apr 24 '17 15:04 Perezmarc

Any news @Judp0m ?

Perezmarc avatar Apr 27 '17 12:04 Perezmarc

@Perezmarc Did you find a solution? I have the same problem.

ChristianBorresen avatar May 04 '17 12:05 ChristianBorresen

Not sure what's happening myself. Will mark for investigation.

filipesilva avatar May 04 '17 13:05 filipesilva

I am also experiencing the same error, not using angular-cli.

Flood avatar May 11 '17 09:05 Flood

Same here

Hatibovic avatar May 11 '17 09:05 Hatibovic

Closing in favor of https://github.com/angular/angular/issues/16718, there seems to be a solution there as well. Thanks to @Flood for looking into this.

filipesilva avatar May 11 '17 10:05 filipesilva

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.