Content-Length: 265457 | pFad | http://github.com/angular/angular-cli/issues/26472
91server.ts
is not taken into consideration when running ng serve
with @angular-devkit/angular-builder:dev-server
#26472
Fetched URL: http://github.com/angular/angular-cli/issues/26472
Alternative Proxies:
Uh oh!
There was an error while loading. Please reload this page.
Command
serve
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When setting up a new application with SSR on, the development mode (
ng serve
) doesn't use the content from theserver.ts
file. It looks like the build process only checks whether theserver.ts
file exists - even if the file is empty, the build goes through without issues and the app is served but if it's missing, you get an error like this:If your app depends on some custom logic written in server.ts, e.g custom providers, injecting those into your app doesn't work right now in dev mode and it throws an error:
NullInjectorError: No provider for [your_injectable]
.Minimal Reproduction
Minimal reproduction:
server.ts
Message from console.log won't appear in the terminal.
Reproduction of example when you want to provide values in
server.ts
(e.g. as in migration steps from @nguniversal to @angular/ssr)ng new test-app --ssr
server.ts
REQUEST
token e.g. inapp.component.ts
ng serve
After opening the app, you'll see
R3InjectionError
:Exception or Error
No response
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: