Skip to content

Angular DevServer: Webpack-dev-middleware ENOENT: No such file or directory Error #31302

@mehdihicheri

Description

@mehdihicheri

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When trying to start an Angular development server, I'm encountering a webpack-dev-middleware error:

<e> [webpack-dev-middleware] Error: ENOENT: no such file or directory,  '.'
<e>     at createError (C:\projets\bl.codage\bl-codage-shell\node_modules\memfs\lib\node\util.js:151:19)
<e>     at Superblock.walk (C:\projets\bl.codage\bl-codage-shell\node_modules\memfs\lib\core\Superblock.js:393:50)
<e>     at Superblock.getResolvedLinkOrThrow (C:\projets\bl.codage\bl-codage-shell\node_modules\memfs\lib\core\Superblock.js:435:21)
<e>     at Superblock.openFile (C:\projets\bl.codage\bl-codage-shell\node_modules\memfs\lib\core\Superblock.js:621:38)
<e>     at Superblock.open (C:\projets\bl.codage\bl-codage-shell\node_modules\memfs\lib\core\Superblock.js:53:31)
<e>     at Superblock.writeFile (C:\projets\bl.codage\bl-codage-shell\node_modules\memfs\lib\core\Superblock.js:64:27)
<e>     at C:\projets\bl.codage\bl-codage-shell\node_modules\memfs\lib\node\volume.js:863:33
<e>     at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
<e>   code: 'ENOENT',
<e>   path: '.'
<e> }

Crucial Context
My project was previously working fine
Another similar project using version 18.2.20 works perfectly
The issue seems specific to version 18.2.21

Attempted Solutions
Cleaned npm cache / ng cache
Reinstalled node modules

Minimal Reproduction

Using cd src && ng serve --c=development --proxy-config src/proxy.conf.json to lunch the app

Exception or Error


Your Environment

Angular CLI: 18.2.12
Node: 22.14.0
Package Manager: npm 10.9.2
OS: win32 x64

Angular: 18.2.13
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1802.21
@angular-devkit/core               18.2.21
@angular-devkit/schematics         18.2.12
@angular/cdk                       18.2.14
@angular/cli                       18.2.12
@angular/material                  18.2.14
@angular/material-moment-adapter   18.2.14
@schematics/angular                18.2.12
ng-packagr                         18.2.1
rxjs                               7.8.1
typescript                         5.5.4
zone.js                            0.14.10

Anything else relevant?

No response

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