nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.63k stars 2.36k forks source link

Nx start/build commands are not working after nx migrate #5753

Closed csaszika closed 3 years ago

csaszika commented 3 years ago

Current Behavior

nx start/build is failed

Expected Behavior

Nx start/build is working

Steps to Reproduce

  1. Normal ng11 project in nrwl workspace
  2. Run nx migrate latest
  3. npm install (everything went good)
  4. 'nx migrate --run-migrations
  5. nx start throws error

Note: nx test work well. As the logs says below the issue comes up in workspace.js and this line(57) is failing: node_modules/@nrwl/tao/src/shared/workspace.js: const [modulePath, exportName] = executorConfig.implementation.split('#'); In case of nx test the executorConfig is: { implementation: './src/executors/jest/jest.impl', schema: './src/executors/jest/schema.json', description: 'Run Jest unit tests' } In case of nx start: { class: './src/browser', schema: './src/browser/schema.json', description: 'Build a browser app.' }

Failure Logs

Cannot read property 'split' of undefined
    at Workspaces.readExecutor (/Users/balintcsaszar/repos/plan-it/node_modules/@nrwl/tao/src/shared/workspace.js:73:19)
    at TaskOrchestrator.readExecutor (/Users/balintcsaszar/repos/plan-it/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:258:18)
    at TaskOrchestrator.customHasher (/Users/balintcsaszar/repos/plan-it/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:245:28)
    at TaskOrchestrator.<anonymous> (/Users/balintcsaszar/repos/plan-it/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:118:33)
    at Generator.next (<anonymous>)
    at /Users/balintcsaszar/repos/plan-it/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/Users/balintcsaszar/repos/plan-it/node_modules/tslib/tslib.js:113:16)
    at TaskOrchestrator.hashTask (/Users/balintcsaszar/repos/plan-it/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:117:24)
    at TaskOrchestrator.<anonymous> (/Users/balintcsaszar/repos/plan-it/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:90:55)
Unexpected error:
Error: Unable to load hasher for task "plan-it:build"
    at TaskOrchestrator.customHasher (/Users/balintcsaszar/repos/plan-it/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:250:19)
    at TaskOrchestrator.<anonymous> (/Users/balintcsaszar/repos/plan-it/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:118:33)
    at Generator.next (<anonymous>)
    at /Users/balintcsaszar/repos/plan-it/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/Users/balintcsaszar/repos/plan-it/node_modules/tslib/tslib.js:113:16)
    at TaskOrchestrator.hashTask (/Users/balintcsaszar/repos/plan-it/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:117:24)
    at TaskOrchestrator.<anonymous> (/Users/balintcsaszar/repos/plan-it/node_modules/@nrwl/workspace/src/tasks-runner/task-orchestrator.js:90:55)
    at Generator.next (<anonymous>)
    at /Users/balintcsaszar/repos/plan-it/node_modules/tslib/tslib.js:117:75

Environment

` Node : 16.2.0 OS : darwin x64 npm : 7.13.0

nx : Not Found @nrwl/angular : 12.3.4 @nrwl/cli : 12.3.4 @nrwl/cypress : 12.3.4 @nrwl/devkit : 12.3.4 @nrwl/eslint-plugin-nx : 12.3.4 @nrwl/express : Not Found @nrwl/jest : 12.3.4 @nrwl/linter : 12.3.4 @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/react : Not Found @nrwl/schematics : Not Found @nrwl/tao : 12.3.4 @nrwl/web : 12.3.4 @nrwl/workspace : 12.3.4 @nrwl/storybook : Not Found @nrwl/gatsby : Not Found typescript : 4.2.4 `

csaszika commented 3 years ago

Another day I did these steps:

  1. Normal ng11 project in nrwl workspace
  2. Run nx migrate latest
  3. npm cache clean -f
  4. delete package-lock.json
  5. npm i --legacy-peer-deps --force
  6. ng serve
  7. everything works well

Probably something was cached...

Anyway the mentioned executorConfig now looks like this:

{
  implementation: './src/dev-server',
  schema: './src/dev-server/schema.json',
  description: 'Serve a browser application.'
}

so implementation field is there.

github-actions[bot] commented 1 year ago

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.