Skip to content
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

Remix server runs (by NX) and fails after short time without not specific error #9151

Open
kosiakMD opened this issue Mar 27, 2024 · 2 comments

Comments

@kosiakMD
Copy link

Reproduction

First of all, I know that's it could be the issue with @nx/remix runner, but if not might be can help me here?

  1. Navigate to the project directory in the terminal.
  2. Run the command nx serve web to start the NX Remix application.
  3. Observe that the process enters into a recursive or infinite loop.
  4. Attempt to connect to the local server at 127.0.0.1:3000.
  5. Observe the ECONNREFUSED error.

System Info

System:
    OS: macOS 14.2.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 48.20 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.0.0 - ~/.nvm/versions/node/v21.0.0/bin/node
    Yarn: 1.22.21 - /opt/homebrew/bin/yarn
    npm: 10.2.0 - ~/.nvm/versions/node/v21.0.0/bin/npm
    Watchman: 2024.03.18.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 123.0.6312.59
    Safari: 17.2.1
  npmPackages:
    @remix-run/css-bundle: ^2.8.1 => 2.8.1 
    @remix-run/dev: ^2.8.1 => 2.8.1 
    @remix-run/eslint-config: ^2.8.1 => 2.8.1 
    @remix-run/node: ^2.8.1 => 2.8.1 
    @remix-run/react: ^2.8.1 => 2.8.1 
    @remix-run/router: ^1.15.3 => 1.15.3 
    @remix-run/serve: ^2.8.1 => 2.8.1 
    @remix-run/testing: ^2.8.1 => 2.8.1

Used Package Manager

npm

Expected Behavior

Expected Behavior: The nx serve web command should start the NX Remix application without additional infinite connection logs. The application should run and listen on 127.0.0.1:3000 without refusing connections.

Actual Behavior

Current Behavior: When running the nx serve web command to start the NX Remix application, the process infinitely logs "Connecting on 127.0.0.1:3000" every second. The app works. The process runs indefinitely until it's suddenly stopped. Additionally, when trying to connect to the local server at 127.0.0.1:3000, the connection is refused with an ECONNREFUSED error.

@kosiakMD kosiakMD changed the title NX Remix server runs and fails after short time without not specific error Remix server runs (by NX) and fails after short time without not specific error Mar 27, 2024
@brophdawg11
Copy link
Contributor

Could you provide a minimal reproduction repo?

@brophdawg11 brophdawg11 added needs-response We need a response from the original author about this issue/PR package:serve package:dev labels Mar 29, 2024
@kosiakMD
Copy link
Author

kosiakMD commented Mar 29, 2024

@brophdawg11 basically, the issue is only on my own Mac, all the rest developers aren't struggling with this
I cleaned caches, node modules, updated remix and nx, and still the same result
I'm mostly asking about any assumptions or suggestions on where to look or what to change in some configs
Before adding additional logging to see connecting by nx server before Remix started, I was sure it was a watcher issue, but now I see it starts to connect before the remix build started

my remix app project file

{
  "name": "web",
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "apps/web",
  "projectType": "application",
  "tags": [],
  "targets": {
    "build": {
      "executor": "@nx/remix:build",
      "outputs": ["{options.outputPath}"],
      "options": {
        "outputPath": "dist/apps/web"
      },
      "configurations": {
        "production": {
          "sourcemap": false
        },
        "development": {
          "sourcemap": true
        }
      }
    },
    "lint": {
      "executor": "nx:run-commands",
      "options": {
        "command": "eslint ./src/**/*.{ts,tsx}",
        "cwd": "{projectRoot}"
      }
    },
    "lint-nx": {
      "executor": "@nx/eslint:lint",
      "outputs": ["{options.outputFile}"],
      "options": {
        "lintFilePatterns": ["apps/web/src/**/*.{ts,tsx}"]
      }
    },
    "serve": {
      "executor": "@nx/remix:serve",
      "options": {
        "port": 3000
      }
    },
    "start": {
      "dependsOn": ["build"],
      "command": "remix-serve build",
      "options": {
        "cwd": "apps/web"
      }
    },
    "typecheck": {
      "command": "tsc",
      "options": {
        "cwd": "apps/web"
      }
    },
    "storybook": {
      "executor": "@nx/storybook:storybook",
      "options": {
        "port": 4400,
        "configDir": "apps/web/.storybook"
      },
      "configurations": {
        "ci": {
          "quiet": true
        }
      }
    },
    "build-storybook": {
      "executor": "@nx/storybook:build",
      "outputs": ["{options.outputDir}"],
      "options": {
        "outputDir": "dist/storybook/web",
        "configDir": "apps/web/.storybook"
      },
      "configurations": {
        "ci": {
          "quiet": true
        }
      }
    },
    "test-storybook": {
      "executor": "nx:run-commands",
      "options": {
        "command": "test-storybook -c apps/web/.storybook --url=http://localhost:4400"
      }
    },
    "static-storybook": {
      "executor": "@nx/web:file-server",
      "options": {
        "buildTarget": "web:build-storybook",
        "staticFilePath": "dist/storybook/web"
      },
      "configurations": {
        "ci": {
          "buildTarget": "web:build-storybook:ci"
        }
      }
    },
    "docker-build": {
      "dependsOn": ["build"],
      "command": "docker build -f apps/web/Dockerfile . -t web"
    }
  }
}

@github-actions github-actions bot removed the needs-response We need a response from the original author about this issue/PR label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants