Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Angular SSR run fails with Module parse failed: 'with' in strict mode #1777

@matthiasunt

Description

@matthiasunt

🐞 bug report

Description

I'm trying to build & run my Angular SSR (Angular Universal) app, whereas the 3rd script fails:

ng run web:build --configuration=production
ng run web:server --configuration=production
ng run web-ssr:serve

With the below error.

🔥 Exception or Error


ERROR in ./dist/apps/web/server/main.js 178387:16
Module parse failed: 'with' in strict mode (178387:16)
File was processed with these loaders:
 * ./node_modules/ts-loader/index.js
You may need an additional loader to handle the result of these loaders.
|                 if (file)
|                     code += '\n//@ sourceURL=' + file;
>                 with (this)
|                     eval(code);
|             },
There was an error with the build. See above.
/Users/user/project/dist/apps/web-ssr/main.js was not restarted.

🌍 Your Environment

Angular Version:


@angular-devkit/architect                  0.900.7
@angular-devkit/build-angular              0.901.6
@angular-devkit/build-optimizer            0.901.6
@angular-devkit/build-webpack              0.901.11
@angular-devkit/core                       9.1.6
@angular-devkit/schematics                 9.1.6
@angular/cdk                               9.2.3
@angular/cli                               9.1.6
@angular/fire                              6.0.0
@angular/material                          9.2.3
@angular/platform-server                   9.1.12
@ngtools/webpack                           9.1.6
@nguniversal/common                        10.0.1
@nguniversal/express-engine                10.0.1
@nguniversal/module-map-ngfactory-loader   8.2.6
@schematics/angular                        9.1.11
@schematics/update                         0.901.6
rxjs                                       6.5.5
typescript                                 3.8.3
webpack                                    4.42.0

Anything else relevant?
My server bundle target is es2015.

I've tried the solution proposed in #35327 but it didn't resolve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions