question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prerender - Unable to access REQUEST token

See original GitHub issue

🐞 Bug report

What modules are related to this issue?

  • builders
  • express-engine

Is this a regression?

Not sure. Trying pretender builder for the first time.

Description

A clear and concise description of the problem...

🔬 Minimal Reproduction

We have had SSR for some time now. We access the request when on the server through import { REQUEST } from '@nguniversal/express-engine/tokens';. We are able to get the injected class using the REQUEST token when running SSR. However, when we run pretender, we are not able to access REQUEST. We get the following error. When trying to access the token like so…

constructor(private injector: Injector) { this.injector.get(REQUEST); }

Want to reiterate that this works fine with SSR, so its not a core issue with the use of REQUEST not working, but with it not working with prerender. Does prerender not actually make a request? If so how do Universal applications that rely on the request information run prerender?

🔥 Exception or Error


Unable to render /Users/zach.morgan/Development/Web.Seeker/dist/apps/seeker/browser/index.html.
Error: R3InjectorError(AppServerModule)[EffectsFeatureModule -> EffectsRootModule -> InjectionToken @ngrx/effects Root Effects -> UIEffects -> ReportingService -> UserDataService -> CookiesService -> REQUEST -> REQUEST -> REQUEST]: 
  NullInjectorError: No provider for REQUEST!

🌍 Your Environment


    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 11.2.11
Node: 14.16.0
OS: darwin x64

Angular: 11.2.12
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker
Ivy Workspace: <error>

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1000.4
@angular-devkit/build-angular      0.1102.11
@angular-devkit/build-ng-packagr   0.1000.4
@angular-devkit/core               11.2.12
@angular-devkit/schematics         11.2.12
@angular/cdk                       11.2.11
@angular/cli                       11.2.11
@angular/material                  11.2.11
@angular/material-moment-adapter   11.2.11
@nguniversal/aspnetcore-engine     11.2.1
@nguniversal/builders              11.2.1
@nguniversal/common                11.2.1
@nguniversal/express-engine        11.2.1
@schematics/angular                9.1.0
@schematics/update                 0.1102.11
ng-packagr                         11.0.3
rxjs                               6.6.7
typescript                         4.0.5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
sir-captainmorgan21commented, Jun 2, 2021

@alan-agius4 thanks. That’s what I figured but just wanted to confirm. We are usingREQUEST to access the domain and path. I think there are better ways to do what we’re are doing that is making us use REQUEST, so I’ll take care of that. Thanks again.

0reactions
angular-automatic-lock-bot[bot]commented, Jul 3, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prerender not detecting the token request - Stack Overflow
I think this line might be returning the index.html file before the Prerender.io config is being run: try_files $uri $uri/ /index.html ...
Read more >
Status Codes - Troubleshooting - Prerender.io
503 (Service Unavailable) If your Prerender.io subscription is canceled, this code will be shown when trying to use your token.
Read more >
How can I test the Integration? - Prerender.io
To test your integration, install your middleware first, then download our open source Prerender server anywhere on your local machine:.
Read more >
How does Prerender.io work? - Getting Started
The first time this happens, the page won't be in the cache, called a cache miss.
Read more >
What can I do with Prerender.io Rest API?
Check cache clear job status. This is a GET request. You will need to provide your API token in the URL.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found