Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DaveO-Home opened this issue Mar 28, 2022 · 1 comment · Fixed by #22917
Closed

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

DaveO-Home opened this issue Mar 28, 2022 · 1 comment · Fixed by #22917

Comments

@DaveO-Home
Copy link

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

@JoostK JoostK transferred this issue from angular/angular Mar 28, 2022
@ngbot ngbot bot modified the milestone: Backlog Mar 28, 2022
alan-agius4 added a commit that referenced this issue Mar 30, 2022
…udes RegExp

Without the `node_modules` prefix, projects named the same as the excluded package names ex: `webpack` will not compile successfully as all files under the mentioned project will be excluded from being requested by the respective loaders.

Closes #22902
alan-agius4 added a commit that referenced this issue Mar 30, 2022
…udes RegExp

Without the `node_modules` prefix, projects named the same as the excluded package names ex: `webpack` will not compile successfully as all files under the mentioned project will be excluded from being requested by the respective loaders.

Closes #22902

(cherry picked from commit 371da23)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants