"Cannot find project 'pieces-x'" when trying to publish a custom piece

:wave: hello there,

I need help to publish a custom piece into our hosted version of Activepieces on a distant server.

We built a piece in activepieces/packages/pieces/custom/sellsy

:white_check_mark: on local environment, npm start works fine, everything is ok, I can use the cusotm piece, update it etc…

:x: BUT, when I try to publish the piece to a distant version of Activepieces (on our test environment)
I’ve an error on step npx nx build pieces-sellsy --skip-cache
saying NX Cannot find project 'pieces-sellsy'

Error is triggered when using :point_down: :
npm run publish-piece-to-api or npm run build-piece

Does someone have any idea from where this error came from ? and how to fix it ?

npm run build-piece

> activepieces@0.50.5 build-piece
> npx ts-node packages/cli/src/index.ts pieces build

? Enter the piece folder name sellsy
Error: Command failed: npx nx build pieces-sellsy --skip-cache

    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:517:28)
    at ChildProcess.emit (node:domain:489:12)
    at maybeClose (node:internal/child_process:1098:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:303:5) {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'npx nx build pieces-sellsy --skip-cache',
  stdout: "\n NX   Cannot find project 'pieces-sellsy'\n\n",
  stderr: ''
}


:information_source: Data

  • directory of the piece : packages/pieces/custom/sellsy
  • in package.json of the piece : "name": "@activepieces/piece-sellsy"
  • in project.json of the piece : "name": "pieces-sellsy"
  • exec of npx nx show projects | grep sellsy shows nothing

:speech_balloon: What we tried

We try to move the custom/sellsy into community/sellsy, and now npx nx show projects | grep sellsy shows a result. BUT, when try to built, we had 2k log lines

Error: Command failed: npx nx build pieces-sellsy --skip-cache

packages/pieces/community/common/src/index.ts:1:15 - error TS6059: File '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/lib/authentication/index.ts' is not under 'rootDir' '/home/{my_user}/Projects/activepieces/packages/pieces/community/sellsy'. 'rootDir' is expected to contain all source files.
Stacktrace (60 first lines)
npm run build-piece

> activepieces@0.50.5 build-piece
> npx ts-node packages/cli/src/index.ts pieces build

? Enter the piece folder name sellsy
Error: Command failed: npx nx build pieces-sellsy --skip-cache
packages/pieces/community/common/src/index.ts:1:15 - error TS6059: File '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/lib/authentication/index.ts' is not under 'rootDir' '/home/{my_user}/Projects/activepieces/packages/pieces/community/sellsy'. 'rootDir' is expected to contain all source files.
  The file is in the program because:
    Imported via './lib/authentication' from file '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/index.ts'
    Imported via '../../authentication' from file '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/lib/http/core/delegating-authentication-converter.ts'
    Imported via '../../authentication' from file '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/lib/http/core/base-http-client.ts'
    Imported via '../../authentication' from file '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/lib/http/core/http-request.ts'

1 export * from './lib/authentication';
                ~~~~~~~~~~~~~~~~~~~~~~

  packages/pieces/community/common/src/lib/http/core/delegating-authentication-converter.ts:8:8
    8 } from '../../authentication';
             ~~~~~~~~~~~~~~~~~~~~~~
    File is included via import here.
  packages/pieces/community/common/src/lib/http/core/base-http-client.ts:1:32
    1 import { Authentication } from '../../authentication';
                                     ~~~~~~~~~~~~~~~~~~~~~~
    File is included via import here.
  packages/pieces/community/common/src/lib/http/core/http-request.ts:4:32
    4 import { Authentication } from '../../authentication';
                                     ~~~~~~~~~~~~~~~~~~~~~~
    File is included via import here.
packages/pieces/community/common/src/index.ts:2:15 - error TS6059: File '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/lib/helpers/index.ts' is not under 'rootDir' '/home/{my_user}/Projects/activepieces/packages/pieces/community/sellsy'. 'rootDir' is expected to contain all source files.

2 export * from './lib/helpers';
                ~~~~~~~~~~~~~~~
packages/pieces/community/common/src/index.ts:4:15 - error TS6059: File '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/lib/polling/index.ts' is not under 'rootDir' '/home/{my_user}/Projects/activepieces/packages/pieces/community/sellsy'. 'rootDir' is expected to contain all source files.

4 export * from './lib/polling';
                ~~~~~~~~~~~~~~~
packages/pieces/community/common/src/index.ts:5:15 - error TS6059: File '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/lib/ai/index.ts' is not under 'rootDir' '/home/{my_user}/Projects/activepieces/packages/pieces/community/sellsy'. 'rootDir' is expected to contain all source files.
  The file is in the program because:
    Imported via './lib/ai' from file '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/index.ts'
    Imported via '../..' from file '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/lib/ai/providers/anthropic/index.ts'
    Imported via '../..' from file '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/lib/ai/providers/openai/index.ts'
    Imported via '../index' from file '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/lib/ai/providers/utils.ts'
    Imported via '../..' from file '/home/{my_user}/Projects/activepieces/packages/pieces/community/common/src/lib/ai/providers/replicate/index.ts'

5 export * from './lib/ai';
                ~~~~~~~~~~

  packages/pieces/community/common/src/lib/ai/providers/anthropic/index.ts:3:43
    3 import { AI, AIChatRole, AIFactory } from '../..';
                                                ~~~~~~~
    File is included via import here.
  packages/pieces/community/common/src/lib/ai/providers/openai/index.ts:1:43
    1 import { AI, AIChatRole, AIFactory } from '../..';
                                                ~~~~~~~
    File is included via import here.
  packages/pieces/community/common/src/lib/ai/providers/utils.ts:7:8
    7 } from '../index';
             ~~~~~~~~~~
    File is included via import here.
  packages/pieces/community/common/src/lib/ai/providers/replicate/index.ts:4:43
    4 import { AI, AIChatRole, AIFactory } from '../..';
                                                ~~~~~~~

I’m pretty sure it’s something about the sellsy location directly (in a packages/pieces/custom, but, by now we want to keep our custom piece private, but publish it into our future multiple instances

And of course, I’d read about Publish Custom Pieces - Activepieces :slight_smile:

(seen with Mohammad) Thanks again for the quick response of the Activepieces team :pray:

It seems to be an problem with either my tsconfig.base.json (on root path), either on our custom piece project.json (the recently added i18n asset was missing)

What we do ?

  • Check with our eyes the main files of the custom pieces
    => nothing :x:
  • Try to manually build our piece, npx nx build pieces-sellsy --skip-cache
    => same error :x:
    even with manually update on root tsconfig.base.json to declare our missing piece
  • Create a new empty piece using npm run cli pieces create
    => build for this empty piece was ok
    :heavy_check_mark:
  • Copy our custom piece src folder inside the new one created**
    => build is ok now :heavy_check_mark: :tada:**

Next, I try to compare the new created piece and the “old” one, and differences are :

  • project.json of the piece, the asset related to recently releases i18n feature on Activepieces was missing
  • outside the piece folder, tsconfig.base.json, on root path, was updated, adding the piece-sellsy
    => I suspect it was just this part who create this behaviour. We recently make change on our fork, and probably this change has been discarded previously :person_shrugging:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.