nrwl / nx

Smart Monorepos · Fast CI

Home Page:https://nx.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"serve-static" target leads to endless loop in angular application

JonasLuechau opened this issue · comments

Current Behavior

I'm trying to use a cached build, serve it and use it with Cypress, but the "serve-static" target/the @nx/web:file-server executor leads to an endless loop where NX builds the app again and again. If I use the underlying http-server package directly I can serve the build without problems.

Expected Behavior

The executor shoud just serve the app after building the app once.

GitHub Repo

No response

Steps to Reproduce

  1. npx create-nx-workspace@latest
  2. Choose angular, integrated monorepo, webpack as bundler, scss, no prerendering, cypress and gitlab
  3. In your new workspace use "npx nx run [your project]:serve-static"
  4. It will run into an endless loop and build the app over and over (while reading from cache)

Nx Report

Node   : 20.11.1
OS     : darwin-arm64
npm    : 10.2.4

nx (global)        : 18.2.4
nx                 : 19.4.3
@nx/js             : 19.4.3
@nx/jest           : 19.4.3
@nx/linter         : 19.4.3
@nx/eslint         : 19.4.3
@nx/workspace      : 19.4.3
@nx/angular        : 19.4.3
@nx/cypress        : 19.4.3
@nx/devkit         : 19.4.3
@nx/eslint-plugin  : 19.4.3
@nrwl/tao          : 19.4.3
@nx/web            : 19.4.3
@nx/webpack        : 19.4.3
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/cypress/plugin
@nx/eslint/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

I can't reproduce this on Nx 19.5.0 (just released).

Can you try again with that?