Error on npm run serve:ssr
See original GitHub issueDescribe the bug
I’m trying to build and serve a local app in ssr mode but npm run server:ssr
crash.
To Reproduce Steps to reproduce the behavior:
npm install angular-oauth2-oidc --save
- add
OAuthModule.forRoot()
on AppModule npm run build:ssr && npm run serve:ssr
ornpm run dev:ssr
Expected behavior Node Express server listening on http://localhost:4000
Additional context
ReferenceError: Document is not defined at Module../node_modules/angular-oauth2-oidc/fesm2015/angular-oauth2-oidc.js
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:36 (11 by maintainers)
Top Results From Across the Web
$npm run server error - node.js - Stack Overflow
I think the command you're trying to run is: npm run serve. Not: npm run server.
Read more >Getting this error when I run "npm run server" #19362 - GitHub
Hello! So, the way npm run server works is that it looks in your current package.json for a defined "server" ...
Read more >http-server - npm
A simple zero-configuration command-line http server. Latest version: 14.1.1, last published: 7 months ago. Start using http-server in your ...
Read more >15 Common Error Codes in Node.js and How to Fix Them
js and npm ), or when you try to run a server on a port lower than 1024. fs.readFile('/etc/sudoers' ...
Read more >Fiori npm run start, server instantly ends without error
Hi there, in past we had success with installing VSCode and Fiori Tools but we discover issues with fresh installation.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I created a new Angular 9 project and added SSR, keeping everything default.
Then as a test, I injected the DOCUMENT token in AppComponent and use it in ngOnInit(). I could not reproduce the problem.
However, as soon as I added angular-oauth2-oidc and
OAuthModule.forRoot
in AppModule I got the error (Document is not defined) on build.Seems to me there is something specific with angular-oauth2-oidc. If I get some more time I will do some more testing.
still no news about this issue ? i’ve tried some fixes on my side but without any luck yet …