Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

961
Views
Uncaught SyntaxError: Strict mode code may not include a with statement

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 */

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

I removed this line export { renderModule, renderModuleFactory } from '@angular/platform-server'; as suggested here and here but the issue occures only when I add ServerModule to imports array

@NgModule({
  imports: [/*AppModule,*/ ServerModule],
  //  bootstrap: [AppComponent],
})
export class AppServerModule {}
// export { renderModule, renderModuleFactory } from '@angular/platform-server';

when removing ServerModule the build executed successfully

over 4 years ago · Santiago Trujillo Report

0

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';
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!