TrilonIO / aspnetcore-angular-universal

ASP.NET Core & Angular Universal advanced starter - PWA w/ server-side rendering for SEO, Bootstrap, i18n internationalization, TypeScript, unit testing, WebAPI REST setup, SignalR, Swagger docs, and more! By @TrilonIO
https://www.trilon.io
MIT License
1.46k stars 435 forks source link

Build in prod impediments after migrate to Angular 7.2.0 #716

Closed GetTaxSolutions closed 5 years ago

GetTaxSolutions commented 5 years ago

I get clean cloning of the repository. Install all packages and start: npm run build:prod It show follow error:

ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.3.0 but 3.3.3 was found instead.

If you try to pin typescript to version 3.1.3 removing ^ it's working.

GetTaxSolutions commented 5 years ago

Also after that I'm retrieving one other error:

ERROR in Module build failed (from ./node_modules/css-loader/dist/cjs.js): ValidationError: CSS Loader Invalid Options

Maybe because of this: css-loader issue minimize option

But this is in my separate project and It's not appear in boilerplate. May be because in my project I'm trying to import .css (not only .scss) files and this webpack.config option in last version of css-loader is not available:

css-loader?minimize

alexbenitez commented 5 years ago

@GetTaxSolutions having exactly the same issue... (also separate project based on the starter v6). Getting the "Angular Compiler requires Typescript... " error and after pinning to 3.1.3 then I got the css-loader error....

So far I have only updated the package.json with the new versions... not sure if there is something relevant that I need to modify yet..

Have you found a workaround/fix?

GetTaxSolutions commented 5 years ago

For now I just removed 'minimize' parameter from css-loader?minimize and it's working.

alexbenitez commented 5 years ago

Thanks @GetTaxSolutions. Now I realized were this parameter was... as a workaround I renamed my “css” file extensions to scss to prevent using the css-loader since I had a mix anyway but your solution I a lot better since it allows css support.

Thx!

alexbenitez commented 5 years ago

I started to get back the error and in addition I needed to downgrade typescript as follows:

npm install typescript@">=3.1.1 <3.3.0" --save-dev

I forgot that I had done this but realized it was also needed when tried from a different machine... typescript update AND the css-loader were my issues in my case.

peterblazejewicz commented 5 years ago

@GetTaxSolutions Let me know if branch from #718 works for you, Thanks!

GetTaxSolutions commented 5 years ago

It's OK

MarkPieszak commented 5 years ago

Sorry for the delay all!! I merged in @peterblazejewicz fix - let me know if everything is ok with that?

GetTaxSolutions commented 5 years ago

It's OK for me

alexbenitez commented 5 years ago

Thanks @MarkPieszak . It works like a charm!