Currently facing an issue while developing an Angular App with SSR. When using npm run build:ssr
, the following errors are displayed:
ERROR in [...]/tsconfig.json
[tsl] ERROR
TS6306: Referenced project '[...]/tsconfig.app.json' must have setting "composite": true.
ERROR in [...]/tsconfig.json
[tsl] ERROR
TS6306: Referenced project '[...]/tsconfig.server.json' must have setting "composite": true.
Attempts to resolve by adding the key to tsconfig.app.json
and tsconfig.server.json
were made, but unsure where exactly to include it:
tsconfig.app.json (and tsconfig.server.json accordingly)
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": [],
"composite": true // <-- generates error below
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
],
"exclude": [
"src/test.ts",
"src/**/*.spec.ts"
],
"composite": true // <-- no effect
}
However, after including the key as advised above, encountered the following error during compilation for each typescript file:
ERROR in error TS6304: Composite projects may not disable declaration emit.
(Clearly, this approach is incorrect...)
Key Details:
- Angular v 10.0.5
- SSR support added through
@nguniversal/express-engine
ng serve
functions properly
Key Files:
{project dependencies}
Project Structure:
{angular project setup}
Seeking assistance from the community as I navigate my way through this newfound challenge of implementing SSR. Any guidance or suggestions would be greatly appreciated. Thank you!