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

NX Cannot read properties of undefined (reading 'indexOf') #27557

Closed
4 tasks
uginroot opened this issue Aug 21, 2024 · 1 comment
Closed
4 tasks

NX Cannot read properties of undefined (reading 'indexOf') #27557

uginroot opened this issue Aug 21, 2024 · 1 comment

Comments

@uginroot
Copy link

uginroot commented Aug 21, 2024

Current Behavior

When running the yarn nx command two times in a row inside a dockerfile (not manifested locally), an error occurs:

NX Cannot read properties of undefined (reading 'indexOf')
// ./node_modules/nx/src/project-graph/project-graph.js:228

image

The variable e contains an object with a letter in each property. If you put it all together in a string, you get Failed to start plugin worker..

Found this error in the source code. It's located here:

./node_modules/nx/src/project-graph/plugins/isolation/plugin-pool.js:259

image

In the ipcPath variable there is a line with the following content /tmp/plugin57-0.sock50, maybe this will help.

At the moment I managed to get rid of this error with RUN rm -rf /tmp/* after every run of yarn nx ....

This error occurs both when running the image build on the local machine and in github actions.

Expected Behavior

The nx commands inside dockerfile run sequentially without having to clear the /tmp/* directory.

GitHub Repo

No response

Steps to Reproduce

  1. Create Dockerfile
  2. Run several yarn nx ... commands in a row.

image

Nx Report

#12 [build  4/13] RUN yarn nx report
#12 3.587 
#12 3.587  NX   Report complete - copy this into the issue template
#12 3.587 
#12 3.587 Node   : 18.15.0
#12 3.587 OS     : linux-x64
#12 3.587 yarn   : 3.6.1
#12 3.587 
#12 3.587 nx             : 19.5.3
#12 3.587 @nx/js         : 19.5.3
#12 3.587 @nx/jest       : 19.5.3
#12 3.587 @nx/workspace  : 19.5.3
#12 3.587 @nx/devkit     : 19.5.3
#12 3.588 @nrwl/tao      : 19.5.3
#12 3.588 typescript     : 5.5.4

Failure Logs

33.30 TypeError: Cannot read properties of undefined (reading 'indexOf')
33.30     at createProjectGraphAndSourceMapsAsync (/app/node_modules/nx/src/project-graph/project-graph.js:228:27)
33.30     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
33.30     at async createProjectGraphAsync (/app/node_modules/nx/src/project-graph/project-graph.js:198:39)
33.30     at async Object.runOne (/app/node_modules/nx/src/command-line/run/run-one.js:24:26)
33.30     at async /app/node_modules/nx/src/command-line/run/command-object.js:19:13
33.30     at async handleErrors (/app/node_modules/nx/src/utils/params.js:22:24)
33.30     at async Object.handler (/app/node_modules/nx/src/command-line/run/command-object.js:18:26)

Package Manager Version

No response

Operating System

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

Additional Information

No response

@Coly010
Copy link
Contributor

Coly010 commented Aug 21, 2024

Fixed by this: #27426 and available in latest Nx (19.6.1)

@Coly010 Coly010 closed this as completed Aug 21, 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