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

Error: The externalDependency 'vite' for could not be found #22929

Closed
1 of 4 tasks
ianzone opened this issue Apr 21, 2024 · 10 comments
Closed
1 of 4 tasks

Error: The externalDependency 'vite' for could not be found #22929

ianzone opened this issue Apr 21, 2024 · 10 comments

Comments

@ianzone
Copy link

ianzone commented Apr 21, 2024

Current Behavior

 󰰶 ❯ cat /home/ian/test/mono/.nx/cache/d/daemon.log
[NX Daemon Server] - 2024-04-21T10:09:29.376Z - Started listening on: /tmp/434751e04e3ab0371150/d.sock
[NX Daemon Server] - 2024-04-21T10:09:29.377Z - [WATCHER]: Subscribed to changes within: /home/ian/test/mono (native)
[NX Daemon Server] - 2024-04-21T10:09:29.379Z - Established a connection. Number of open connections: 1
[NX Daemon Server] - 2024-04-21T10:09:29.380Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-04-21T10:09:29.381Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-04-21T10:09:29.469Z - [REQUEST]: Updated workspace context based on watched changes, recomputing project graph...
[NX Daemon Server] - 2024-04-21T10:09:29.469Z - [REQUEST]:
[NX Daemon Server] - 2024-04-21T10:09:29.469Z - [REQUEST]:
[NX Daemon Server] - 2024-04-21T10:09:29.503Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-04-21T10:09:29.503Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-04-21T10:09:29.504Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 122. Response time: 1.
[NX Daemon Server] - 2024-04-21T10:09:29.504Z - Time taken for 'total for creating and serializing project graph' 121.57939399965107ms
[NX Daemon Server] - 2024-04-21T10:09:29.504Z - Closed a connection. Number of open connections: 1
[NX Daemon Server] - 2024-04-21T10:09:29.505Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-04-21T10:09:29.505Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-04-21T10:09:29.505Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-04-21T10:09:29.506Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 0. Response time: 1.
[NX Daemon Server] - 2024-04-21T10:09:29.506Z - Time taken for 'total for creating and serializing project graph' 0.7792239990085363ms
[NX Daemon Server] - 2024-04-21T10:09:29.506Z - Established a connection. Number of open connections: 2
[NX Daemon Server] - 2024-04-21T10:09:59.798Z - Established a connection. Number of open connections: 3
[NX Daemon Server] - 2024-04-21T10:09:59.803Z - Established a connection. Number of open connections: 4
[NX Daemon Server] - 2024-04-21T10:09:59.803Z - Closed a connection. Number of open connections: 3
[NX Daemon Server] - 2024-04-21T10:09:59.803Z - [REQUEST]: Client Request for Project Graph Received
[NX Daemon Server] - 2024-04-21T10:09:59.804Z - [REQUEST]: Responding to the client. project-graph
[NX Daemon Server] - 2024-04-21T10:09:59.804Z - Done responding to the client project-graph
[NX Daemon Server] - 2024-04-21T10:09:59.804Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 1. Response time: 0.
[NX Daemon Server] - 2024-04-21T10:09:59.804Z - Time taken for 'total for creating and serializing project graph' 0.7505759987980127ms
/home/ian/test/mono/node_modules/nx/src/hasher/native-task-hasher-impl.js:32
        const plans = this.planner.getPlansReference(tasks.map((t) => t.id), taskGraph);
                                   ^

Error: The externalDependency 'vite' for 'spa:build' could not be found
    at NativeTaskHasherImpl.hashTasks (/home/ian/test/mono/node_modules/nx/src/hasher/native-task-hasher-impl.js:32:36)
    at InProcessTaskHasher.hashTasks (/home/ian/test/mono/node_modules/nx/src/hasher/task-hasher.js:53:50)
    at handleHashTasks (/home/ian/test/mono/node_modules/nx/src/daemon/server/handle-hash-tasks.js:30:56)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async handleResult (/home/ian/test/mono/node_modules/nx/src/daemon/server/server.js:107:16)
    at async handleMessage (/home/ian/test/mono/node_modules/nx/src/daemon/server/server.js:81:9)
    at async /home/ian/test/mono/node_modules/nx/src/daemon/server/server.js:45:9 {
  code: 'GenericFailure'
}

Node.js v18.18.2

Expected Behavior

no error

GitHub Repo

No response

Steps to Reproduce

use pnpm 9.0.4 or bun 1.1.4

  1. pnpx create-nx-workspace mono --pm pnpm
  2. add a react integrated app
  3. run nx build to build that app

Nx Report

NX   Report complete - copy this into the issue template

Node   : 20.12.2
OS     : linux-x64
npm    : 10.5.0

nx (global)        : 18.3.3
nx                 : 18.3.3
@nx/js             : 18.3.3
@nx/linter         : 18.3.3
@nx/eslint         : 18.3.3
@nx/workspace      : 18.3.3
@nx/cypress        : 18.3.3
@nx/devkit         : 18.3.3
@nx/eslint-plugin  : 18.3.3
@nx/playwright     : 18.3.3
@nx/react          : 18.3.3
@nrwl/tao          : 18.3.3
@nx/vite           : 18.3.3
@nx/web            : 18.3.3
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/vite/plugin
@nx/eslint/plugin
@nx/playwright/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

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

Additional Information

No response

@ltlaitoff
Copy link

ltlaitoff commented Apr 22, 2024

Same error, but on NX 18.2.3

@viperactual
Copy link

viperactual commented Apr 22, 2024

I'm getting the same error, but instead of vite, its for eslint.

Error: The externalDependency 'eslint' for 'prisma-postgres:lint' could not be found

It's running on a prisma format command. I just found this, so I haven't been able to dig further, but I'll be back with more updates if I have something.

@ianzone

#22871 (comment)

Try downgrading your PNPM version for 8.15.7

@adrien1251
Copy link

Hello, how are you ? :D

I have the same issue, any new for a compatibility of the version 9.x of pnpm with nx ?

Thanks :)

@DibyodyutiMondal
Copy link

DibyodyutiMondal commented Apr 23, 2024

Not just dev dependencies such as vite or eslint, it also misses out on the correct processing of run-time dependencies.

For example, for a node.js app, if you use the @nx/esbuild:esbuild executor and specify thirdParty: false, it will still bundle the thirdParty deps, because it fails to recognise the npm dependencies as third party deps, because when it tries to compute the array of external dependencies from the project graph, the resulting array is empty.

@benpsnyder
Copy link
Contributor

Experiencing the same thing

@ampcpmgp
Copy link

I get the same error in my local environment.
It is not happening in CircleCI.

In addition to vite, eslint and vitest also.

 NX   Report complete - copy this into the issue template

Node   : 20.12.0
OS     : linux-x64
yarn   : 1.22.19

nx                 : 18.0.8
@nx/js             : 18.0.8
@nx/jest           : 18.0.8
@nx/linter         : 18.0.8
@nx/eslint         : 18.0.8
@nx/workspace      : 18.0.8
@nx/cypress        : 18.0.8
@nx/devkit         : 18.0.8
@nx/eslint-plugin  : 18.0.8
@nx/nest           : 18.0.8
@nx/node           : 18.0.8
@nx/playwright     : 18.0.8
@nx/plugin         : 18.0.8
@nx/react          : 18.0.8
@nx/storybook      : 18.0.8
@nrwl/tao          : 18.0.8
@nx/vite           : 18.0.8
@nx/web            : 18.0.8
@nx/webpack        : 18.0.8
typescript         : 5.3.3
---------------------------------------
Local workspace plugins:
         <REPOSITORY_NAME>/workspace-plugin

@anteqkois
Copy link

anteqkois commented Apr 28, 2024

I'm also get this issue but with next app (when I run nx run web:build):

[NX Daemon Server] - 2024-04-28T17:00:57.232Z - Handled REQUEST_PROJECT_GRAPH. Handling time: 1735. Response time: 4.
.../node_modules/.pnpm/nx@18.3.4_@swc-node+register@1.8.0_@swc+core@1.3.107_@swc+helpers@0.5.11__@swc+types@0.1.6_ty_3or5kepauvcjdtis55oxcjxylq/node_modules/nx/src/hasher/native-task-hasher-impl.js:32
        const plans = this.planner.getPlansReference(tasks.map((t) => t.id), taskGraph);
                                   ^

Error: The externalDependency 'next' for 'web:build' could not be found
    at NativeTaskHasherImpl.hashTasks (/.../node_modules/.pnpm/nx@18.3.4_@swc-node+register@1.8.0_@swc+core@1.3.107_@swc+helpers@0.5.11__@swc+types@0.1.6_ty_3or5kepauvcjdtis55oxcjxylq/node_modules/nx/src/hasher/native-task-hasher-impl.js:32:36)

NX report:

Node   : 20.11.1
OS     : darwin-arm64
pnpm   : 9.0.6

nx (global)        : 18.3.4
nx                 : 18.3.4
@nx/js             : 18.3.4
@nx/jest           : 18.3.4
@nx/eslint         : 18.3.4
@nx/workspace      : 18.3.4
@nx/cypress        : 18.3.4
@nx/eslint-plugin  : 18.3.4
@nx/next           : 18.3.4
@nx/react          : 18.3.4
@nrwl/tao          : 18.3.4
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/next/plugin
@nx/cypress/plugin
@nx/eslint/plugin
@nx/jest/plugin

@ampcpmgp
Copy link

In my case, I improved by the following

  1. clean installation of the repository
  2. bring nx up to latest version.
  3. do an nx reset

@AgentEnder
Copy link
Member

Nx doesn't support pnpm 9 yet. Support for that is currently being tracked in #22850. I'm going to close this as a duplicate.

Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants