Repository navigation
Closed
Milestone
Description
🐞 Bug report
Command (mark with an x)
- [ ] new
- [x] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [x] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Is this a regression?
Yes
Description
Currently in ngtools we rely on isMainPath, getEntryModule to run the export_ngfactory transformer, however in version 9 the main will be pointing to server.ts rather than main.server.ts.
This causes the transformer to run on the wrong file in VE.
🔬 Minimal Reproduction
- npx i @angular/[email protected] new universal-test
- cd universal-test
- ng add @nguniversal/[email protected]
- disable ivy
- in
server.tschangeAppServerModuletoAppServerModuleNgFactoryto use AOT as otherwise you will use the JIT version of the code. - npm run build:ssr
🔥 Exception or Error
ERROR in server.ts:7:10 - error TS2305: Module '"C:/git/cli-repos/terser/src/main.server"' has no exported member 'AppServerModuleNgFactory'.
7 import { AppServerModuleNgFactory } from './src/main.server';
~~~~~~~~~~~~~~~~~~~~~~~~
🌍 Your Environment
Angular CLI: 9.0.0-next.9
Node: 12.10.0
OS: win32 x64
Angular: 9.0.0-next.10
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.900.0-next.9
@angular-devkit/build-angular 0.900.0-next.9
@angular-devkit/build-optimizer 0.900.0-next.9
@angular-devkit/build-webpack 0.900.0-next.9
@angular-devkit/core 9.0.0-next.9
@angular-devkit/schematics 9.0.0-next.9
@angular/cli 9.0.0-next.9
@angular/platform-server 9.0.0-next.11
@ngtools/webpack 9.0.0-next.9
@nguniversal/common 9.0.0-next.5
@nguniversal/express-engine 9.0.0-next.5
@schematics/angular 9.0.0-next.9
@schematics/update 0.900.0-next.9
rxjs 6.5.3
typescript 3.5.3
webpack 4.41.0
Anything else relevant?
As a workaround users need to manually add the below export in main.server.ts
export { AppServerModuleNgFactory } from './app/app.server.module.ngfactory';
Activity
vikerman commentedon Oct 17, 2019
Part of Ivy opt out story for ssr.
vikerman commentedon Oct 31, 2019
For opting out let's ask the users to
alan-agius4 commentedon Nov 7, 2019
Being addressed in angular/angular#33616
alan-agius4 commentedon Nov 8, 2019
Docs PR merged.
angular-automatic-lock-bot commentedon Dec 9, 2019
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.