8000 New application fails to build due to unhandled exception: Cannot find module './compile.js' · Issue #30622 · angular/angular-cli · GitHub
[go: up one dir, main page]

Skip to content
New application fails to build due to unhandled exception: Cannot find module './compile.js' #30622
Closed
@Slartron

Description

@Slartron

Command

new

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

Don't know

Description

After creating a new angular app with ng new and running ng build I get the error

[error] Error: Cannot find module './compile.js'
Require stack:
- D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\css-select\lib\index.js
- D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\beasties\dist\index.cjs
- D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\@angular\build\src\utils\index-file\inline-critical-css.js
- D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\@angular\build\src\utils\index-file\index-html-generator.js
- D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\@angular\build\src\tools\esbuild\index-html-generator.js
- D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\@angular\build\src\builders\application\execute-post-bundle.js
- D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\@angular\build\src\builders\application\execute-build.js
- D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\@angular\build\src\builders\application\index.js
- D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\@angular\build\src\private.js
- D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\@angular-devkit\build-angular\src\builders\dev-server\builder.js
- D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\@angular-devkit\build-angular\src\builders\dev-server\index.js
- D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1369:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
    at Module._load (node:internal/modules/cjs/loader:1179:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.require (node:internal/modules/cjs/loader:1449:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (D:\dev\slartron\lista-de-bebida\dormeltup\node_modules\css-select\lib\index.js:12:20)
    at Module._compile (node:internal/modules/cjs/loader:1692:14)

Root cause of this error could be found in this select-css issue

Workaround for this failure is to downgrade css-select to v5.1.0
npm i css-select@5.1.0

Minimal Reproduction

npx -p @angular/cli@19 ng new brokenapp
ng build

Exception or Error


Your Environment

Angular CLI: 19.2.15
Node: 22.12.0
Package Manager: npm 11.0.0
OS: win32 x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1902.15
@angular-devkit/build-angular   19.2.15
@angular-devkit/core            19.2.15
@angular-devkit/schematics      19.2.15
@angular/cli                    19.2.15
@schematics/angular             19.2.15
rxjs                            7.8.2
typescript                      5.7.3
zone.js                         0.15.1

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

      0