Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error npm run build #604

Open
brendorsilva opened this issue Nov 10, 2023 · 7 comments
Open

Error npm run build #604

brendorsilva opened this issue Nov 10, 2023 · 7 comments
Labels

Comments

@brendorsilva
Copy link

When running npm run build I am receiving the following error:

deploy@admistrador-Standard-PC-i440FX-PIIX-1996:~/whaticket/backend$ npm run build

backend@1.0.0 build
tsc

src/services/WbotServices/wbotMessageListener.ts:152:77 - error TS2339: Property 'description' does not exist on type 'Location'.

152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body });
~~~~~~~~~~~

src/services/WbotServices/wbotMessageListener.ts:152:124 - error TS2339: Property 'description' does not exist on type 'Location'.

152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body });
~~~~~~~~~~~

src/services/WbotServices/wbotMessageListener.ts:162:35 - error TS2339: Property 'description' does not exist on type 'Location'.

162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))
~~~~~~~~~~~

src/services/WbotServices/wbotMessageListener.ts:162:62 - error TS2339: Property 'description' does not exist on type 'Location'.

162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))
~~~~~~~~~~~

Found 4 errors.

@alissonerai
Copy link

estou com o mesmo problema , nao encontrei em lugar algum a soluçao ,

src/services/WbotServices/wbotMessageListener.ts:152:77 - error TS2339: Property 'description' does not exist on type 'Location'.

152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body });

      ~~~~~~~~~~~

src/services/WbotServices/wbotMessageListener.ts:152:124 - error TS2339: Property 'description' does not
exist on type 'Location'.

152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body });

                  ~~~~~~~~~~~  

src/services/WbotServices/wbotMessageListener.ts:162:35 - error TS2339: Property 'description' does not exist on type 'Location'.

162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))


src/services/WbotServices/wbotMessageListener.ts:162:62 - error TS2339: Property 'description' does not exist on type 'Location'.

162   msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))     
 
                           ~~~~~~~~~~~


Found 4 errors.

@brendorsilva brendorsilva changed the title Error npm run bulid Error npm run build Nov 13, 2023
@egorky
Copy link

egorky commented Nov 27, 2023

well, you have to change in this file backend/src/services/WbotServices/wbotMessageListener.ts the following:
const prepareLocation = (msg: WbotMessage): WbotMessage => {
const gmapsUrl = https://maps.google.com/maps?q=${msg.location.latitude}%2C${msg.location.longitude}&z=17;
msg.body = data:image/png;base64,${msg.body}|${gmapsUrl};
msg.body += |${msg.location.options ? msg.location.options : ${msg.location.latitude}, ${msg.location.longitude} };
return msg;
};

const verifyMessage = async (
msg: WbotMessage,
ticket: Ticket,
contact: Contact
) => {
if (msg.type === "location") msg = prepareLocation(msg);

const quotedMsg = await verifyQuotedMessage(msg);
const messageData = {
id: msg.id.id,
ticketId: ticket.id,
contactId: msg.fromMe ? undefined : contact.id,
body: msg.body,
fromMe: msg.fromMe,
mediaType: msg.type,
read: msg.fromMe,
quotedMsgId: quotedMsg?.id
};

await ticket.update({
lastMessage:
msg.type === "location"
? msg.location.options || "Localization"
: msg.body
});

await CreateMessageService({ messageData });
};

@mfallas1905
Copy link

Thanks @egorky for your solution

@HZetaVirus
Copy link

Mano boa noite estou com esses erros abaixo

npm run build

backend@1.0.0 build
tsc

src/services/WbotServices/wbotMessageListener.ts:152:77 - error TS2339: Property 'description' does not exist on type 'Location'.

152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body });
~~~~~~~~~~~

src/services/WbotServices/wbotMessageListener.ts:152:124 - error TS2339: Property 'description' does not exist on type 'Location'.

152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body });
~~~~~~~~~~~

src/services/WbotServices/wbotMessageListener.ts:162:35 - error TS2339: Property 'description' does not exist on type 'Location'.

162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))
~~~~~~~~~~~

src/services/WbotServices/wbotMessageListener.ts:162:62 - error TS2339: Property 'description' does not exist on type 'Location'.

162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude))
~~~~~~~~~~~

Found 4 errors.

Poderia me passar uma possivel solução desde já agradecido !

@Luskan777
Copy link

Luskan777 commented Dec 13, 2023

Mano boa noite estou com esses erros abaixo

npm run build

backend@1.0.0 build
tsc

src/services/WbotServices/wbotMessageListener.ts:152:77 - error TS2339: Property 'description' does not exist on type 'Location'.

152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body }); ~~~~~~~~~~~

src/services/WbotServices/wbotMessageListener.ts:152:124 - error TS2339: Property 'description' does not exist on type 'Location'.

152 await ticket.update({ lastMessage: msg.type === "location" ? msg.location.description ? "Localization - " + msg.location.description.split('\n')[0] : "Localization" : msg.body }); ~~~~~~~~~~~

src/services/WbotServices/wbotMessageListener.ts:162:35 - error TS2339: Property 'description' does not exist on type 'Location'.

162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude)) ~~~~~~~~~~~

src/services/WbotServices/wbotMessageListener.ts:162:62 - error TS2339: Property 'description' does not exist on type 'Location'.

162 msg.body += "|" + (msg.location.description ? msg.location.description : (msg.location.latitude + ", " + msg.location.longitude)) ~~~~~~~~~~~

Found 4 errors.

Poderia me passar uma possivel solução desde já agradecido !

Hi, here's the correction in my fork.
Replace the link file to your respective target (backend/src/services/WbotServices/wbotMessageListener.ts)

Credits @egorky

@disaring
Copy link

That's solved but my chats getting delayed now. Any idea?

Copy link

stale bot commented Mar 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants