nx icon indicating copy to clipboard operation
nx copied to clipboard

Can't use Nextra with Nx -- based on #22515

Open jonasschultheiss opened this issue 4 months ago • 1 comments

Current Behavior

Adding Nextra to Nx makes it so that Nx is unable to build the dependency graph without the hack described in the original issue (#22515).

Expected Behavior

Be able to migrate my turbo, next, nextra monorepo to Nx.

GitHub Repo

No response

Steps to Reproduce

See the original issue (#22515)

Nx Report

Node : 22.9.0 OS : darwin-arm64 Native Target : aarch64-macos pnpm : 9.12.2

nx (global) : 20.0.1 nx : 20.0.1 @nx/eslint : 20.0.1 @nx/next : 20.0.1 typescript : 5.6.3

Registered Plugins: @nx/next/plugin @nx/eslint/plugin

⚠️ Unable to construct project graph. Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it. Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.

Failure Logs

  An error occurred while processing files for the @nx/next/plugin plugin.
- apps/docs/next.config.mjs: > Couldn't find any `pages` or `app` directory. Please create one under the project root
  Error: > Couldn't find any `pages` or `app` directory. Please create one under the project root
      at Module.findPagesDir (/Users/jonasschultheiss/project_dir/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/lib/find-pages-dir.js:42:15)
      at findPagesDirectory (file:///Users/jonasschultheiss/project_dir/node_modules/.pnpm/[email protected]_@[email protected][email protected]_@[email protected][email protected][email protected]_6ne7gbb66ylnuww3p3l6vuytre/node_modules/nextra/dist/server/file-system.js:4:28)
      at file:///Users/jonasschultheiss/project_dir/node_modules/.pnpm/[email protected]_@[email protected][email protected]_@[email protected][email protected][email protected]_6ne7gbb66ylnuww3p3l6vuytre/node_modules/nextra/dist/server/file-system.js:10:19
      at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
      at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
      at async load (/Users/jonasschultheiss/project_dir/node_modules/.pnpm/@[email protected][email protected]/node_modules/@nx/devkit/src/utils/config-utils.js:82:20)
      at async loadConfigFile (/Users/jonasschultheiss/project_dir/node_modules/.pnpm/@[email protected][email protected]/node_modules/@nx/devkit/src/utils/config-utils.js:36:22)
      at async buildNextTargets (/Users/jonasschultheiss/project_dir/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_@zkochan+js-ya_vldoolhpypydphnr55gp6jdxua/node_modules/@nx/next/src/plugins/plugin.js:53:24)
      at async exports.createNodes (/Users/jonasschultheiss/project_dir/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_@zkochan+js-ya_vldoolhpypydphnr55gp6jdxua/node_modules/@nx/next/src/plugins/plugin.js:41:32)
      at async /Users/jonasschultheiss/project_dir/node_modules/.pnpm/[email protected]/node_modules/nx/src/project-graph/plugins/utils.js:10:27

Package Manager Version

No response

Operating System

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

Additional Information

The dirty fix works, but is unmaintainable. i dont want a random folder in my monorepo, just because I'm using nextra. A Nx dev responded saying it's fixed, but didn't mention a release, pr or commit -> how is it fixed? is it really?

jonasschultheiss avatar Oct 17 '24 11:10 jonasschultheiss