Skip to content

ng test/build fail after "ng new" with project name "webpack"  #22902

@DaveO-Home

Description

@DaveO-Home

Which @angular/* package(s) are the source of the bug?

compiler-cli

Is this a regression?

No

Description

After scaffolding a new project with the project name "webpack" commands like ng test and ng build fail. Process:

ng new
? What name would you like to use for the new workspace and initial project? webpack
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? CSS

Please provide a link to a minimal reproduction of the bug

none

Please provide the exception or error you saw

ng test
✔ Browser application bundle generation complete.

./src/test.ts:10:8 - Error: Module parse failed: Unexpected token (10:8)
File was processed with these loaders:
 * ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js
You may need an additional loader to handle the result of these loaders.
| } from '@angular/platform-browser-dynamic/testing';
| 
> declare const require: {
|   context(path: string, deep?: boolean, filter?: RegExp): {
|     <T>(id: string): T;

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 13.3.0
Node: 16.14.0
Package Manager: npm 8.5.1
OS: linux x64

Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1303.0
@angular-devkit/core         13.3.0
@angular-devkit/schematics   13.3.0
@schematics/angular          13.3.0

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions