Getting Errror In Angular-CLI SSR
Hi, I tried all the steps from https://github.com/angular/angular-cli/wiki/stories-universal-rendering
After running this command npm run build:ssr && npm run serve:ssr, got the below error:
`ERROR in ./server.ts Module build failed: TypeError: Cannot read property 'afterCompile' of undefined
at successfulTypeScriptInstance (D:\ssr\node_modules\ts-loader\dist\instance
s.js:147:28)
at Object.getTypeScriptInstance (D:\ssr\node_modules\ts-loader\dist\instance
s.js:48:12)
at Object.loader (D:\ssr\node_modules\ts-loader\dist\index.js:16:41)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] webpack:server: webpack --config webpack.server.config.js --
progress --colors
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] webpack:server script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\eshiksha\AppData\Roaming\npm-cache_logs\2018-03-08T07_46_
29_034Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build:ssr: npm run build:client-and-server-bundles && npm ru
n webpack:server
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build:ssr script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\eshiksha\AppData\Roaming\npm-cache_logs\2018-03-08T07_46_ 29_091Z-debug.log`
https://github.com/TypeStrong/ts-loader/releases/tag/v4.0.0
I think this is because TypeScript dropped support for webpack 2/3, as pointed out by @georgebonney in #9783 .
Downgrading to ts-loader 3.5.0 should temporarily solve this problem
@Hayden-Yu Yes you are right, it worked on ts-loader 3.5.0
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.