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

ProjectsWithNoNameError error after updating to v19 #23522

Open
4 tasks
knoefel opened this issue May 19, 2024 · 3 comments
Open
4 tasks

ProjectsWithNoNameError error after updating to v19 #23522

knoefel opened this issue May 19, 2024 · 3 comments
Assignees
Labels
scope: core core nx functionality type: bug

Comments

@knoefel
Copy link

knoefel commented May 19, 2024

Current Behavior

After making a build for a Next.js app inside a dockerfile and then afterwards running a command to generate a siemap via next-sitemap i get the following error ProjectsWithNoNameError: The projects in the following directories have no name provided:.

Screenshot 2024-05-19 at 16 45 40

I looked inside the dist folder and there is a package.json file generated in both folders:

  • dist/apps/shopfront/.next
  • dist/apps/shopfront/.next/standalone/dist/apps/shopfront/.next

When i manually remove this package.json files and run the command again it will succeed. I guess these files don't have a name prop which nx expects?

Expected Behavior

It's possible to run all commands without removing package.json files. I think this issue could be related to #20959.

GitHub Repo

No response

Steps to Reproduce

As my project is a private repo i can't share the source code.

Nx Report

Node   : 20.8.0
OS     : darwin-arm64
npm    : 10.1.0

nx (global)        : 19.0.4
nx                 : 19.0.4
@nx/js             : 19.0.4
@nx/jest           : 19.0.4
@nx/linter         : 19.0.4
@nx/eslint         : 19.0.4
@nx/workspace      : 19.0.4
@nx/cypress        : 19.0.4
@nx/devkit         : 19.0.4
@nx/eslint-plugin  : 19.0.4
@nx/next           : 19.0.4
@nx/playwright     : 19.0.4
@nx/react          : 19.0.4
@nx/rollup         : 19.0.4
@nx/storybook      : 19.0.4
@nrwl/tao          : 19.0.4
@nx/web            : 19.0.4
@nx/webpack        : 19.0.4
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/rollup/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

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

Additional Information

No response

@FrozenPandaz FrozenPandaz added the scope: core core nx functionality label May 21, 2024
@jogelin
Copy link
Contributor

jogelin commented May 29, 2024

Same issue here. I didn't investigate why exactly but it is related to:

  • Upgrade to Nx 19
  • Plugin inference activated
  • Windows environments only
  • Server app only

@guillempuche
Copy link

guillempuche commented May 29, 2024

Similar when running my main Expo app. Tested in Nx 19 macos

Storybook is in its own standalone React Native app. Storybook packages v7.6.10 and v7.6.15 for @storybook/react-native.

Nx docs https://nx.dev/recipes/storybook/custom-builder-configs#and are outdated, framework field doesn't exist in StorybookConfig.

yarn exec nx run expo:start
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
  The "@nx/storybook/plugin" plugin threw an error while creating nodes from apps/storybook-rn/.storybook/main.ts:
    TypeError: Cannot read properties of undefined (reading 'name')
        at getStorybookFramework (/Users/guillem/programacio/codi/cites/nx-expo-next-tamagui/node_modules/@nx/storybook/src/plugins/plugin.js:170:66)
        at buildStorybookTargets (/Users/guillem/programacio/codi/cites/nx-expo-next-tamagui/node_modules/@nx/storybook/src/plugins/plugin.js:68:32)
        at Array.exports.createNodes (/Users/guillem/programacio/codi/cites/nx-expo-next-tamagui/node_modules/@nx/storybook/src/plugins/plugin.js:53:32)
        at /Users/guillem/programacio/codi/cites/nx-expo-next-tamagui/node_modules/nx/src/project-graph/plugins/utils.js:49:27
        at async Promise.all (index 0)

@jogelin
Copy link
Contributor

jogelin commented May 30, 2024

I fixed my problem.

My error was a bit different:

Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
  ProjectsWithNoNameError: The projects in the following directories have no name provided:
    - apps\my-app-one
    - apps\my-app-two
    - apps\my-app-three
    - ...

All of the apps above were related to a specific Nx plugin using target inference.

Nx can inject targets into a project configuration by comparing the projectRoot computed with the projectRoot from the list of existing projects .
However, the projectRoot computed can be different between a Windows environment and a Unix environment.

This is why Nx created the utility normalizePath to avoid that use case:

const projectRoot = normalizePath(join(dirname(configFilePath), '..'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: core core nx functionality type: bug
Projects
None yet
Development

No branches or pull requests

5 participants