I have recently updated to Angular v9 and I am getting the following error:
Uncaught SyntaxError: Strict mode code may not include a with statement
This is occuring in the following file:
./node_modules/@angular/animations/__ivy_ngcc__/fesm2015/animations.js
This is an Angular v9 file as per the comments in the file:
/** * @license Angular v9.0.0 * (c) 2010-2020 Google LLC. https://angular.io/ * License: MIT */
This is occuring here, with the with
statement:
module.exports = { Window_run: function _run(code, file) { if (file) code += '\n//@ sourceURL=' + file; with(this) eval(code); },
There is a comment above this line:
/* Domino uses sloppy-mode features (in particular,
with
) for a few * minor things. This file encapsulates all the sloppiness; every * other module should be strict. / / jshint strict: false / / jshint evil: true / / jshint -W085 */
I was searching for the solution to a similar problem. Upgrade to Angular 9 broke my app. After a lot of trial and error this helped me.
Just comment out or remove the following line from main.ts
(added by the upgrade process):
export { renderModule, renderModuleFactory } from '@angular/platform-server';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With