* 描述问题
我做了个二开插件,构建的时候出现这样的问题,请问各位大佬该如何解决
* 运行环境
- NocoBase 版本:2.0.15
- 数据库种类与版本: MySQL8
- 操作系统:macOS
-浏览器及版本
- 部署方式:源码
- Docker 镜像版本:
- NodeJS 版本:
如何重现
预期行为
截图
日志
Error: Failed to build declarations for /Library/workplace/gaofanCode/nocobase/packages/plugins/@nocobase/plugin-auth-wecom
packages/plugins/@nocobase/plugin-auth-wecom/src/client/MessageConfigForm.tsx:4:10 - error TS2614: Module ‘“@nocobase/plugin-notification-manager/client”’ has no exported member ‘UserSelect’. Did you mean to use ‘import UserSelect from “@nocobase/plugin-notification-manager/client”’ instead?
4 import { UserSelect, UserAddition } from ‘@nocobase/plugin-notification-manager/client’;
~~~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/client/MessageConfigForm.tsx:4:22 - error TS2614: Module ‘“@nocobase/plugin-notification-manager/client”’ has no exported member ‘UserAddition’. Did you mean to use ‘import UserAddition from “@nocobase/plugin-notification-manager/client”’ instead?
4 import { UserSelect, UserAddition } from ‘@nocobase/plugin-notification-manager/client’;
~~~~~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/actions/wecom.ts:5:54 - error TS2307: Cannot find module ‘@nocobase/plugin-user-data-sync’ or its corresponding type declarations.
5 import UserDataSyncPlugin, { ExternalAPIError } from ‘@nocobase/plugin-user-data-sync’;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/plugin.ts:6:32 - error TS2307: Cannot find module ‘@nocobase/plugin-user-data-sync’ or its corresponding type declarations.
6 import UserDataSyncPlugin from ‘@nocobase/plugin-user-data-sync’;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/plugin.ts:8:45 - error TS2307: Cannot find module ‘@nocobase/plugin-notification-manager’ or its corresponding type declarations.
8 import PluginNotificationManagerServer from ‘@nocobase/plugin-notification-manager’;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-client.ts:3:34 - error TS2307: Cannot find module ‘@nocobase/plugin-user-data-sync’ or its corresponding type declarations.
3 import { ExternalAPIError } from ‘@nocobase/plugin-user-data-sync’;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:1:67 - error TS2307: Cannot find module ‘@nocobase/plugin-notification-manager’ or its corresponding type declarations.
1 import { BaseNotificationChannel, parseUserSelectionConfig } from ‘@nocobase/plugin-notification-manager’;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:8:10 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
8 this.app.logger.debug('WecomNotificationChannel.send: args: ’ + JSON.stringify(args));
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:17:14 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
17 this.app.logger.debug('WecomNotificationChannel.send: recipients: ’ + JSON.stringify(recipients));
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:18:31 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
18 const userRepo = this.app.db.getRepository(‘users’);
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:21:12 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
21 this.app.logger.debug('WecomNotificationChannel.send: userIds: ’ + JSON.stringify(userIds));
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:22:38 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
22 const authenticatorRepo = this.app.db.getRepository(‘authenticators’);
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:24:12 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
24 this.app.logger.debug('WecomNotificationChannel.send: auth: ’ + JSON.stringify(auth));
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:25:44 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
25 const usersAuthenticatorsRepo = this.app.db.getRepository(‘usersAuthenticators’);
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:34:12 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
34 this.app.logger.debug('WecomNotificationChannel.send: usersAuths: ’ + JSON.stringify(usersAuths));
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:39:56 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
39 const { corpId, agentId, secret, origin } = this.app.environment.renderJsonTemplate(auth.options.wecom);
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:44:19 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
44 app: this.app,
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:61:23 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
61 app: this.app.name,
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:68:14 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
68 this.app.logger.debug('WecomNotificationChannel.send: markdown: ’ + JSON.stringify(markdown));
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:71:14 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
71 this.app.logger.debug('WecomNotificationChannel.send: template_card: ’ + JSON.stringify(template_card));
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:85:14 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
85 this.app.logger.debug('WecomNotificationChannel.send: textcard: ’ + JSON.stringify(textcard));
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-notification-channel.ts:96:12 - error TS2339: Property ‘app’ does not exist on type ‘WecomNotificationChannel’.
96 this.app.logger.error(‘WecomNotificationChannel.send failed’ + JSON.stringify(error));
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-service.ts:2:38 - error TS2307: Cannot find module ‘@nocobase/plugin-user-data-sync’ or its corresponding type declarations.
2 import PluginUserDataSyncServer from ‘@nocobase/plugin-user-data-sync’;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-sync-source.ts:1:38 - error TS2307: Cannot find module ‘@nocobase/plugin-user-data-sync’ or its corresponding type declarations.
1 import { SyncSource, UserData } from ‘@nocobase/plugin-user-data-sync’;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-sync-source.ts:7:20 - error TS2339: Property ‘instance’ does not exist on type ‘WecomSyncSource’.
7 corpId: this.instance.options?.wecom?.corpId,
~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-sync-source.ts:8:20 - error TS2339: Property ‘instance’ does not exist on type ‘WecomSyncSource’.
8 secret: this.instance.options?.wecom?.secret,
~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-sync-source.ts:9:21 - error TS2339: Property ‘instance’ does not exist on type ‘WecomSyncSource’.
9 agentId: this.instance.options?.wecom?.agentId,
~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-sync-source.ts:10:17 - error TS2339: Property ‘ctx’ does not exist on type ‘WecomSyncSource’.
10 ctx: this.ctx,
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-sync-source.ts:54:10 - error TS2339: Property ‘ctx’ does not exist on type ‘WecomSyncSource’.
54 this.ctx.log.debug(${users.length} users: ${JSON.stringify(users)});
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-sync-source.ts:62:10 - error TS2339: Property ‘ctx’ does not exist on type ‘WecomSyncSource’.
62 this.ctx.log.debug(${departments.length} departments: ${JSON.stringify(departments)});
~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-sync-source.ts:68:26 - error TS2339: Property ‘instance’ does not exist on type ‘WecomSyncSource’.
68 sourceName: this.instance.name,
~~~~~~~~
packages/plugins/@nocobase/plugin-auth-wecom/src/server/wecom-sync-source.ts:74:26 - error TS2339: Property ‘instance’ does not exist on type ‘WecomSyncSource’.
74 sourceName: this.instance.name,
~~~~~~~~
at buildDeclaration (/Library/workplace/gaofanCode/nocobase/packages/core/build/lib/buildDeclaration.js:100:11)
at buildPackage (/Library/workplace/gaofanCode/nocobase/packages/core/build/lib/build.js:120:5)
at buildPackages (/Library/workplace/gaofanCode/nocobase/packages/core/build/lib/build.js:92:5)
at build (/Library/workplace/gaofanCode/nocobase/packages/core/build/lib/build.js:78:3)
Node.js v20.20.2
/Library/workplace/gaofanCode/nocobase/node_modules/execa/lib/error.js:60
error = new Error(message);
^
Error: Command failed with exit code 1: nocobase-build
at makeError (/Library/workplace/gaofanCode/nocobase/node_modules/execa/lib/error.js:60:11)
at handlePromise (/Library/workplace/gaofanCode/nocobase/node_modules/execa/index.js:118:26)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Command. (/Library/workplace/gaofanCode/nocobase/packages/core/cli/src/commands/build.js:40:7) {
shortMessage: 'Command failed with exit code 1: nocobase-build ',
command: 'nocobase-build ',
escapedCommand: ‘nocobase-build “” “” “” “”’,
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
Node.js v20.20.2
error Command failed with exit code 1.


