nrwl / nx

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

Custom executor do not work with 14.2.1 #10622

Closed DaSchTour closed 2 years ago

DaSchTour commented 2 years ago

Current Behavior

Error: Unable to resolve ./tools/executors/version:version.
Found module undefined while trying to locate ./tools/executors/version/package.json
    at Workspaces.readExecutor (/…/frontend/node_modules/nx/src/config/workspaces.js:95:19)
    at getExecutorForTask (/…/frontend/node_modules/nx/src/tasks-runner/utils.js:163:22)
    at getCustomHasher (/…/frontend/node_modules/nx/src/tasks-runner/utils.js:168:25)
    at TasksSchedule.<anonymous> (/…/frontend/node_modules/nx/src/tasks-runner/tasks-schedule.js:111:62)
    at Generator.next (<anonymous>)
    at /…/frontend/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/…/frontend/node_modules/tslib/tslib.js:113:16)
    at TasksSchedule.hashTask (/…/frontend/node_modules/nx/src/tasks-runner/tasks-schedule.js:110:24)
    at TasksSchedule.<anonymous> (/…/frontend/node_modules/nx/src/tasks-runner/tasks-schedule.js:59:24)
Unexpected error:
Error: Unable to load hasher for task "…:version"
    at getCustomHasher (/…/frontend/node_modules/nx/src/tasks-runner/utils.js:173:15)
    at TasksSchedule.<anonymous> (/…/frontend/node_modules/nx/src/tasks-runner/tasks-schedule.js:111:62)
    at Generator.next (<anonymous>)
    at /…/frontend/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/…/frontend/node_modules/tslib/tslib.js:113:16)
    at TasksSchedule.hashTask (/…/frontend/node_modules/nx/src/tasks-runner/tasks-schedule.js:110:24)
    at TasksSchedule.<anonymous> (/…/frontend/node_modules/nx/src/tasks-runner/tasks-schedule.js:59:24)
    at Generator.next (<anonymous>)
    at /…/frontend/node_modules/tslib/tslib.js:117:75

Expected Behavior

Executor works like with previous versions

Steps to Reproduce

Follow instructions from https://nx.dev/executors/creating-custom-builders

I have the following in tools/executors/version

package.json

{
  "executors": "./executor.json"
}

executor.json

{
  "executors": {
    "version": {
      "implementation": "./impl",
      "schema": "./schema.json",
      "description": "Creates version"
    }
  }
}

schema.json

{
  "$schema": "http://json-schema.org/schema",
  "type": "object",
  "cli": "nx"
}

And a impl.ts but I thing it's content doesn't matter

Failure Logs

Environment

@nrwl/express : Not Found @nrwl/jest : 14.2.1 @nrwl/js : 14.2.1 @nrwl/linter : 14.2.1 @nrwl/nest : 14.2.1 @nrwl/next : Not Found @nrwl/node : 14.2.1 @nrwl/nx-cloud : 14.0.5 @nrwl/nx-plugin : 14.2.1 @nrwl/react : Not Found @nrwl/react-native : Not Found @nrwl/schematics : Not Found @nrwl/storybook : 14.2.1 @nrwl/web : Not Found @nrwl/workspace : 14.2.1 typescript : 4.7.3

Community plugins: @fortawesome/angular-fontawesome: 0.11.0 @ionic/angular: 5.9.1 @nestjs/ng-universal: 6.0.0 @ngrx/component: 13.2.0 @ngrx/component-store: 13.2.0 @ngrx/data: 13.2.0 @ngrx/effects: 13.2.0 @ngrx/entity: 13.2.0 @ngrx/router-store: 13.2.0 @ngrx/store: 13.2.0 @ngrx/store-devtools: 13.2.0 @nguniversal/common: 14.0.0 @nguniversal/express-engine: 14.0.0 apollo-angular: 3.0.1 @compodoc/compodoc: 1.1.19 @ngneat/spectator: 11.0.0 @ngrx/schematics: 13.2.0 @nguniversal/builders: 14.0.0 @nx-tools/nx-docker: 2.3.0 @nxtend/capacitor: 13.0.0 @nxtend/ionic-angular: 13.1.0 @trellisorg/make-buildable: 0.0.10 @twittwer/compodoc: 1.8.0 eslint-plugin-ngrx: 2.1.2 ng-mocks: 13.5.2 ngx-build-plus: 14.0.0 nx-stylelint: 13.4.0

johannesnormannjensen commented 2 years ago

I'm experiencing exactly the same

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.