nx: Serving a scaffolded Remix project in 18.0.3 is broken

Current Behavior

I have created a newly scaffolded Remix project, using the latest (today) version of 18.0.3, since it added Playwright support. I starteed with an empty Nx project, added the remix plugin and then created a Remix app with the new Playwright commandline flag. When trying to serve or build the project, however, the CLI crashes.

Expected Behavior

For the new project to serve the hello world Remix application without crashing.

GitHub Repo

https://github.com/Nvveen/playwright-crash-repro

Steps to Reproduce

  1. pnpm dlx create-nx-workspace --pm pnpm
 >  NX   Let's create a new workspace [https://nx.dev/getting-started/intro]

✔ Where would you like to create your workspace? · playwright-crash-repro
✔ Which stack do you want to use? · none
✔ Package-based monorepo, integrated monorepo, or standalone project? · package-based
✔ Set up CI with caching, distribution and test deflaking · skip
✔ Would you like remote caching to make your build faster? · skip
  1. pnpm dlx nx add @nx/remix
  2. pnpm dlx nx g @nx/remix:app --directory=apps/front --e2eTestRunner=playwright
>  NX  Generating @nx/remix:application

✔ What is the name of the application? · front
✔ What unit test runner should be used? · vitest
✔ What should be the project name and where should it be generated? · front @ apps/front
Fetching @nx/vite...
Fetching @nx/playwright...
UPDATE nx.json
... (shortened for brevity)
  1. pnpm nx run front:serve

Nx Report

>  NX   Report complete - copy this into the issue template

   Node   : 20.11.0
   OS     : linux-x64
   pnpm   : 8.14.1
   
   nx                 : 18.0.3
   @nx/js             : 18.0.3
   @nx/linter         : 18.0.3
   @nx/eslint         : 18.0.3
   @nx/workspace      : 18.0.3
   @nx/devkit         : 18.0.3
   @nx/eslint-plugin  : 18.0.3
   @nx/playwright     : 18.0.3
   @nx/react          : 18.0.3
   @nx/remix          : 18.0.3
   @nrwl/tao          : 18.0.3
   @nx/vite           : 18.0.3
   @nx/web            : 18.0.3
   typescript         : 5.3.3

Failure Logs

> nx run front:serve


 💿  remix dev

Unable to create nodes for apps/front-e2e/playwright.config.ts using plugin @nx/playwright/plugin. 

         Inner Error: Error: ENOENT: no such file or directory, scandir 'apps/front-e2e'
    at readdirSync (node:fs:1515:26)
    at exports.createNodes (/workspaces/playwright-crash-repro/node_modules/.pnpm/@nx+playwright@18.0.3_@playwright+test@1.41.2_@swc-node+register@1.6.8_@swc+core@1.3.107_@typ_ux2zmy6kcfpob67qhjynyuo7jq/node_modules/@nx/playwright/src/plugins/plugin.js:33:51)
    at buildProjectsConfigurationsFromProjectPathsAndPlugins (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
    at createProjectConfigurations (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
    at _retrieveProjectConfigurations (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
    at retrieveProjectConfigurations (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
    at async buildProjectGraphAndSourceMapsWithoutDaemon (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:71:69)
    at async createProjectGraphAndSourceMapsAsync (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:136:25)
    at async createProjectGraphAsync (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:125:39)
    at async createWatchPaths (/workspaces/playwright-crash-repro/node_modules/.pnpm/@nx+remix@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107_@types+node@20.11.16_nx@18.0.3_typescript@5.3.3/node_modules/@nx/remix/src/utils/create-watch-paths.js:14:19)
CreateNodesError: Unable to create nodes for apps/front-e2e/playwright.config.ts using plugin @nx/playwright/plugin. 

         Inner Error: Error: ENOENT: no such file or directory, scandir 'apps/front-e2e'
    at readdirSync (node:fs:1515:26)
    at exports.createNodes (/workspaces/playwright-crash-repro/node_modules/.pnpm/@nx+playwright@18.0.3_@playwright+test@1.41.2_@swc-node+register@1.6.8_@swc+core@1.3.107_@typ_ux2zmy6kcfpob67qhjynyuo7jq/node_modules/@nx/playwright/src/plugins/plugin.js:33:51)
    at buildProjectsConfigurationsFromProjectPathsAndPlugins (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
    at createProjectConfigurations (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
    at _retrieveProjectConfigurations (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
    at retrieveProjectConfigurations (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
    at async buildProjectGraphAndSourceMapsWithoutDaemon (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:71:69)
    at async createProjectGraphAndSourceMapsAsync (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:136:25)
    at async createProjectGraphAsync (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:125:39)
    at async createWatchPaths (/workspaces/playwright-crash-repro/node_modules/.pnpm/@nx+remix@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107_@types+node@20.11.16_nx@18.0.3_typescript@5.3.3/node_modules/@nx/remix/src/utils/create-watch-paths.js:14:19)
    at /workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:156:35
    at async Promise.all (index 0)
    at async Promise.all (index 4)
    at async createProjectConfigurations (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:62) {
  [cause]: Error: ENOENT: no such file or directory, scandir 'apps/front-e2e'
      at readdirSync (node:fs:1515:26)
      at exports.createNodes (/workspaces/playwright-crash-repro/node_modules/.pnpm/@nx+playwright@18.0.3_@playwright+test@1.41.2_@swc-node+register@1.6.8_@swc+core@1.3.107_@typ_ux2zmy6kcfpob67qhjynyuo7jq/node_modules/@nx/playwright/src/plugins/plugin.js:33:51)
      at buildProjectsConfigurationsFromProjectPathsAndPlugins (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/project-configuration-utils.js:148:29)
      at createProjectConfigurations (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:89:156)
      at _retrieveProjectConfigurations (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:61:12)
      at retrieveProjectConfigurations (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js:46:12)
      at async buildProjectGraphAndSourceMapsWithoutDaemon (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:71:69)
      at async createProjectGraphAndSourceMapsAsync (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:136:25)
      at async createProjectGraphAsync (/workspaces/playwright-crash-repro/node_modules/.pnpm/nx@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107/node_modules/nx/src/project-graph/project-graph.js:125:39)
      at async createWatchPaths (/workspaces/playwright-crash-repro/node_modules/.pnpm/@nx+remix@18.0.3_@swc-node+register@1.6.8_@swc+core@1.3.107_@types+node@20.11.16_nx@18.0.3_typescript@5.3.3/node_modules/@nx/remix/src/utils/create-watch-paths.js:14:19) {
    errno: -2,
    code: 'ENOENT',
    syscall: 'scandir',
    path: 'apps/front-e2e'
  }
}

 >  NX   Remix app exited with code 1

   Pass --verbose to see the stacktrace.


 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Running target serve for project front failed

   Failed tasks:
   
   - front:serve
   
   Hint: run the command with --verbose for more details.

Package Manager Version

No response

Operating System

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

Additional Information

This might be important: I am working inside of a devcontainer and have reproduced it in the repo above using github codespaces.

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Reactions: 3
  • Comments: 18 (7 by maintainers)

Most upvoted comments

It works @Coly010.

Thanks

@martialanouman

I see the issue, if you open the tsconfig.spec.json at the root of your remix project, you may see an include and includes.

You need to remove the first include and rename the includes to include.

This should fix the issue.

I’ll also create a PR to fix this in the generation.

@supernaut That is a separate issue and a separate error, please keep this issue focused on Remix.

I see you have already created an issue regarding your problem here: https://github.com/nrwl/nx/issues/21823

Let’s keep your conversation there.

@Nvveen it works fine for me locally without any adjustments, but it fails to work on Cloudflare Pages or GitHub Actions (CI), where I lack control over the node_modules.