[BUG] - Erro ao realizar build na v2 com MYSQL - NVM
Welcome!
- [X] Yes, I have searched for similar issues on GitHub and found none.
What did you do?
Ao tentar realizar o build seguindo a documentação de instalação via NVM.
What did you expect?
Esperava que o build fosse concluido para poder seguir com adocumentação de instalação.
What did you observe instead of what you expected?
evolution-api# npm run build
> [email protected] build
> tsc --noEmit && tsup
src/api/integrations/channel/meta/whatsapp.business.service.ts:564:19 - error TS2322: Type 'string[]' is not assignable to type 'string'.
564 path: ['id'],
~~~~
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:414:13 - error TS2322: Type 'string[]' is not assignable to type 'string'.
414 path: ['id'],
~~~~
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:1276:17 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1276 path: ['id'],
~~~~
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:1374:20 - error TS2353: Object literal may only specify known properties, and 'labelId_instanceId' does not exist in type 'LabelWhereUniqueInput'.
1374 where: { labelId_instanceId: { instanceId: this.instanceId, labelId: label.id } },
~~~~~~~~~~~~~~~~~~
node_modules/.prisma/client/index.d.ts:12795:5
12795 where: LabelWhereUniqueInput
~~~~~
The expected type comes from property 'where' which is declared here on type '{ select?: LabelSelect<DefaultArgs>; include?: LabelInclude<DefaultArgs>; where: LabelWhereUniqueInput; }'
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:1392:15 - error TS2353: Object literal may only specify known properties, and 'labelId_instanceId' does not exist in type 'LabelWhereUniqueInput'.
1392 labelId_instanceId: {
~~~~~~~~~~~~~~~~~~
node_modules/.prisma/client/index.d.ts:12769:5
12769 where: LabelWhereUniqueInput
~~~~~
The expected type comes from property 'where' which is declared here on type '{ select?: LabelSelect<DefaultArgs>; include?: LabelInclude<DefaultArgs>; where: LabelWhereUniqueInput; create: (Without<...> & LabelUncheckedCreateInput) | (Without<...> & LabelCreateInput); update: (Without<...> & LabelUncheckedUpdateInput) | (Without<...> & LabelUpdateInput); }'
src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1357:17 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1357 path: ['fromMe'],
~~~~
src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1392:19 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1392 path: ['id'],
~~~~
src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1441:11 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1441 path: ['id'],
~~~~
src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1460:11 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1460 path: ['id'],
~~~~
src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1850:17 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1850 path: ['id'],
~~~~
src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:2097:19 - error TS2322: Type 'string[]' is not assignable to type 'string'.
2097 path: ['id'],
~~~~
src/api/services/channel.service.ts:530:11 - error TS2322: Type '{ key: { path: string[]; equals: string; }; } | {}' is not assignable to type 'MessageWhereInput'.
Types of property 'key' are incompatible.
Type '{ path: string[]; equals: string; }' is not assignable to type 'JsonFilter<"Message">'.
Types of property 'path' are incompatible.
Type 'string[]' is not assignable to type 'string'.
530 keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:531:11 - error TS2322: Type '{ key: { path: string[]; equals: true; }; } | {}' is not assignable to type 'MessageWhereInput'.
Types of property 'key' are incompatible.
Type '{ path: string[]; equals: true; }' is not assignable to type 'JsonFilter<"Message">'.
Types of property 'path' are incompatible.
Type 'string[]' is not assignable to type 'string'.
531 keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:532:11 - error TS2322: Type '{ key: { path: string[]; equals: string; }; } | {}' is not assignable to type 'MessageWhereInput'.
Types of property 'key' are incompatible.
Type '{ path: string[]; equals: string; }' is not assignable to type 'JsonFilter<"Message">'.
Types of property 'path' are incompatible.
Type 'string[]' is not assignable to type 'string'.
532 remoteJid ? { key: { path: ['remoteJid'], equals: remoteJid } } : {},
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:533:11 - error TS2322: Type '{ key: { path: string[]; equals: string; }; } | {}' is not assignable to type 'MessageWhereInput'.
Types of property 'key' are incompatible.
Type '{ path: string[]; equals: string; }' is not assignable to type 'JsonFilter<"Message">'.
Types of property 'path' are incompatible.
Type 'string[]' is not assignable to type 'string'.
533 keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {},
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:553:11 - error TS2322: Type '{ key: { path: string[]; equals: string; }; } | {}' is not assignable to type 'MessageWhereInput'.
Types of property 'key' are incompatible.
Type '{ path: string[]; equals: string; }' is not assignable to type 'JsonFilter<"Message">'.
Types of property 'path' are incompatible.
Type 'string[]' is not assignable to type 'string'.
553 keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {},
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:554:11 - error TS2322: Type '{ key: { path: string[]; equals: true; }; } | {}' is not assignable to type 'MessageWhereInput'.
Types of property 'key' are incompatible.
Type '{ path: string[]; equals: true; }' is not assignable to type 'JsonFilter<"Message">'.
Types of property 'path' are incompatible.
Type 'string[]' is not assignable to type 'string'.
554 keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {},
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:555:11 - error TS2322: Type '{ key: { path: string[]; equals: string; }; } | {}' is not assignable to type 'MessageWhereInput'.
Types of property 'key' are incompatible.
Type '{ path: string[]; equals: string; }' is not assignable to type 'JsonFilter<"Message">'.
Types of property 'path' are incompatible.
Type 'string[]' is not assignable to type 'string'.
555 remoteJid ? { key: { path: ['remoteJid'], equals: remoteJid } } : {},
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:556:11 - error TS2322: Type '{ key: { path: string[]; equals: string; }; } | {}' is not assignable to type 'MessageWhereInput'.
Types of property 'key' are incompatible.
Type '{ path: string[]; equals: string; }' is not assignable to type 'JsonFilter<"Message">'.
Types of property 'path' are incompatible.
Type 'string[]' is not assignable to type 'string'.
556 keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {},
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 19 errors in 4 files.
Errors Files
1 src/api/integrations/channel/meta/whatsapp.business.service.ts:564
4 src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:414
6 src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1357
8 src/api/services/channel.service.ts:530
Screenshots/Videos
No response
Which version of the API are you using?
2.1.0
What is your environment?
Linux
Other environment specifications
4 vcp e 4GB
If applicable, paste the log output
evolution-api# npm run build
[email protected] build tsc --noEmit && tsup
src/api/integrations/channel/meta/whatsapp.business.service.ts:564:19 - error TS2322: Type 'string[]' is not assignable to type 'string'.
564 path: ['id'], ~~~~
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:414:13 - error TS2322: Type 'string[]' is not assignable to type 'string'.
414 path: ['id'], ~~~~
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:1276:17 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1276 path: ['id'], ~~~~
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:1374:20 - error TS2353: Object literal may only specify known properties, and 'labelId_instanceId' does not exist in type 'LabelWhereUniqueInput'.
1374 where: { labelId_instanceId: { instanceId: this.instanceId, labelId: label.id } }, ~~~~~~~~~~~~~~~~~~
node_modules/.prisma/client/index.d.ts:12795:5 12795 where: LabelWhereUniqueInput ~~~~~ The expected type comes from property 'where' which is declared here on type '{ select?: LabelSelect<DefaultArgs>; include?: LabelInclude<DefaultArgs>; where: LabelWhereUniqueInput; }'
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:1392:15 - error TS2353: Object literal may only specify known properties, and 'labelId_instanceId' does not exist in type 'LabelWhereUniqueInput'.
1392 labelId_instanceId: { ~~~~~~~~~~~~~~~~~~
node_modules/.prisma/client/index.d.ts:12769:5 12769 where: LabelWhereUniqueInput ~~~~~ The expected type comes from property 'where' which is declared here on type '{ select?: LabelSelect<DefaultArgs>; include?: LabelInclude<DefaultArgs>; where: LabelWhereUniqueInput; create: (Without<...> & LabelUncheckedCreateInput) | (Without<...> & LabelCreateInput); update: (Without<...> & LabelUncheckedUpdateInput) | (Without<...> & LabelUpdateInput); }'
src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1357:17 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1357 path: ['fromMe'], ~~~~
src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1392:19 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1392 path: ['id'], ~~~~
src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1441:11 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1441 path: ['id'], ~~~~
src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1460:11 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1460 path: ['id'], ~~~~
src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1850:17 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1850 path: ['id'], ~~~~
src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:2097:19 - error TS2322: Type 'string[]' is not assignable to type 'string'.
2097 path: ['id'], ~~~~
src/api/services/channel.service.ts:530:11 - error TS2322: Type '{ key: { path: string[]; equals: string; }; } | {}' is not assignable to type 'MessageWhereInput'. Types of property 'key' are incompatible. Type '{ path: string[]; equals: string; }' is not assignable to type 'JsonFilter<"Message">'. Types of property 'path' are incompatible. Type 'string[]' is not assignable to type 'string'.
530 keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {}, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:531:11 - error TS2322: Type '{ key: { path: string[]; equals: true; }; } | {}' is not assignable to type 'MessageWhereInput'. Types of property 'key' are incompatible. Type '{ path: string[]; equals: true; }' is not assignable to type 'JsonFilter<"Message">'. Types of property 'path' are incompatible. Type 'string[]' is not assignable to type 'string'.
531 keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {}, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:532:11 - error TS2322: Type '{ key: { path: string[]; equals: string; }; } | {}' is not assignable to type 'MessageWhereInput'. Types of property 'key' are incompatible. Type '{ path: string[]; equals: string; }' is not assignable to type 'JsonFilter<"Message">'. Types of property 'path' are incompatible. Type 'string[]' is not assignable to type 'string'.
532 remoteJid ? { key: { path: ['remoteJid'], equals: remoteJid } } : {}, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:533:11 - error TS2322: Type '{ key: { path: string[]; equals: string; }; } | {}' is not assignable to type 'MessageWhereInput'. Types of property 'key' are incompatible. Type '{ path: string[]; equals: string; }' is not assignable to type 'JsonFilter<"Message">'. Types of property 'path' are incompatible. Type 'string[]' is not assignable to type 'string'.
533 keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {}, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:553:11 - error TS2322: Type '{ key: { path: string[]; equals: string; }; } | {}' is not assignable to type 'MessageWhereInput'. Types of property 'key' are incompatible. Type '{ path: string[]; equals: string; }' is not assignable to type 'JsonFilter<"Message">'. Types of property 'path' are incompatible. Type 'string[]' is not assignable to type 'string'.
553 keyFilters?.id ? { key: { path: ['id'], equals: keyFilters?.id } } : {}, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:554:11 - error TS2322: Type '{ key: { path: string[]; equals: true; }; } | {}' is not assignable to type 'MessageWhereInput'. Types of property 'key' are incompatible. Type '{ path: string[]; equals: true; }' is not assignable to type 'JsonFilter<"Message">'. Types of property 'path' are incompatible. Type 'string[]' is not assignable to type 'string'.
554 keyFilters?.fromMe ? { key: { path: ['fromMe'], equals: keyFilters?.fromMe } } : {}, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:555:11 - error TS2322: Type '{ key: { path: string[]; equals: string; }; } | {}' is not assignable to type 'MessageWhereInput'. Types of property 'key' are incompatible. Type '{ path: string[]; equals: string; }' is not assignable to type 'JsonFilter<"Message">'. Types of property 'path' are incompatible. Type 'string[]' is not assignable to type 'string'.
555 remoteJid ? { key: { path: ['remoteJid'], equals: remoteJid } } : {}, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/api/services/channel.service.ts:556:11 - error TS2322: Type '{ key: { path: string[]; equals: string; }; } | {}' is not assignable to type 'MessageWhereInput'. Types of property 'key' are incompatible. Type '{ path: string[]; equals: string; }' is not assignable to type 'JsonFilter<"Message">'. Types of property 'path' are incompatible. Type 'string[]' is not assignable to type 'string'.
556 keyFilters?.participants ? { key: { path: ['participants'], equals: keyFilters?.participants } } : {}, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 19 errors in 4 files.
Errors Files 1 src/api/integrations/channel/meta/whatsapp.business.service.ts:564 4 src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:414 6 src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1357 8 src/api/services/channel.service.ts:530
Additional Notes
> [email protected] build
> tsc --noEmit && tsup
src/api/integrations/channel/meta/whatsapp.business.service.ts:564:19 - error TS2322: Type 'string[]' is not assignable to type 'string'.
564 path: ['id'],
~~~~
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:414:13 - error TS2322: Type 'string[]' is not assignable to type 'string'.
414 path: ['id'],
~~~~
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:1276:17 - error TS2322: Type 'string[]' is not assignable to type 'string'.
1276 path: ['id'],
~~~~
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:1374:20 - error TS2353: Object literal may only specify known properties, and 'labelId_instanceId' does not exist in type 'LabelWhereUniqueInput'.
1374 where: { labelId_instanceId: { instanceId: this.instanceId, labelId: label.id } },
~~~~~~~~~~~~~~~~~~
node_modules/.prisma/client/index.d.ts:12795:5
12795 where: LabelWhereUniqueInput
~~~~~
The expected type comes from property 'where' which is declared here on type '{ select?: LabelSelect<DefaultArgs>; include?: LabelInclude<DefaultArgs>; where: LabelWhereUniqueInput; }'
src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:1392:15 - error TS2353: Object literal may only specify known properties, and 'labelId_instanceId' does not exist in type 'LabelWhereUniqueInput'.
1392 labelId_instanceId: {
~~~~~~~~~~~~~~~~~~
node_modules/.prisma/client/index.d.ts:12769:5
12769 where: LabelWhereUniqueInput
~~~~~
The expected type comes from property 'where' which is declared here on type '{ select?: LabelSelect<DefaultArgs>; include?: LabelInclude<DefaultArgs>; where: LabelWhereUniqueInput; create: (Without<...> & LabelUncheckedCreateInput) | (Without<...> & LabelCreateInput); update: (Without<...> & LabelUncheckedUpdateInput) | (Without<...> & LabelUpdateInput); }'
Esse erro acontece apenas quando o banco é mysql
solution?
Estou tendo o mesmo problema com o mysql =/
Found 21 errors in 5 files.
Errors Files 1 src/api/integrations/channel/meta/whatsapp.business.service.ts:564 4 src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts:415 6 src/api/integrations/chatbot/chatwoot/services/chatwoot.service.ts:1359 8 src/api/services/channel.service.ts:537 2 src/utils/onWhatsappCache.ts:62
enquanto não funciona com mysql, tenta com postgres que não tem dado problema
solution?
Não cheguei a verificar os erros no fonte, só utilizei o postgres e deu certo.
enquanto não funciona com mysql, tenta com postgres que não tem dado problema
Top meu nobre, fiz isso, por enquanto não cheguei a verificar, só mudei para o postgres.
Pessoal que está implementando migration, só está considerando o postgress, esquecendo de criar tbm para mysql
Praticamente abandonado essa parte do projeto.
acabaram de mandar uma PR pra migration do mysql
o erro continua...
Alguém conseguiu solucionar com o mysql?
Acho que não estão tendo mais interesse em manter a parte do projeto referente ao MySQL.
chegou a testar em uma instalação do zero e com uma versão mais atual? @juniormelo26 pq isso pode ser problema de migration
@dpaes hoje estou usando a versao atual com postgres devido ao problema com mysql, mas vou fazer testes com a versao atual e dou retorno. Obrigado!
Olá, Isso foi corrido @DavidsonGomes ?
tive outros erros relacionados com mysql, rodei o sistema tranquilamente com postgres mas com mysql ele diz tá implementado errado o SQL do prisma, acontece tanto na imagem quanto no NVM.
Pois é, não sei porque foi fechado, sem informações.🙂↕️
Alguém aí tem novas informações? Acabei de testar na V2.3.0(mais recente) com MySQL e não foi resolvido. Alguém poderia, por favor, reabrir essa Issue? Qual foi a linha de raciocínio de quem fechou? "Hur dur, num dei suporte, mas vou fechar porque tô nem aí para o dev"? Tá okey, se não querem dar suporte para subir a instância com MySQL, deixem claro na documentação que não é possível fazer isso, pois ao menos não perderemos nosso tempo.
Grato.