Rocket.Chat.Apps-engine icon indicating copy to clipboard operation
Rocket.Chat.Apps-engine copied to clipboard

URL is not defined in

Open RegisHubelia opened this issue 1 year ago • 2 comments

Server Version: 6.5.3 apps-engine: 1.41.0

Hi,

I am getting the following in the Apps.clickup on the server side:

2024-01-25T15:55:45.852447688-05:00     at OAuth2Client.<anonymous> (/app/bundle/programs/server/npm/node_modules/@rocket.chat/apps-engine/server/oauth2/OAuth2Client.js:79:25)
2024-01-25T15:55:45.852454831-05:00     at Generator.next (<anonymous>)
2024-01-25T15:55:45.852461203-05:00     at fulfilled (/app/bundle/programs/server/npm/node_modules/@rocket.chat/apps-engine/server/oauth2/OAuth2Client.js:5:58)
2024-01-25T15:55:45.852465552-05:00     at VM2 Wrapper.apply (/app/bundle/programs/server/npm/node_modules/vm2/lib/bridge.js:485:11)
2024-01-25T15:55:45.852469059-05:00     at /app/bundle/programs/server/npm/node_modules/meteor/promise/node_modules/meteor-promise/fiber_pool.js:43:40```

Seems like the new URL is causing issue in the file, not 100% sure why.

RegisHubelia avatar Jan 25 '24 20:01 RegisHubelia

I'm getting the same issue in Github App: #139

JeffreytheCoder avatar Mar 08 '24 22:03 JeffreytheCoder

@RegisHubelia I solved this issue by importing URL from url module in OAuth2Client.js.

Although URL should be a global variable in Node.js environment, it appears that projects with older versions of Node, particularly <= v14, share the same issue. For examples: https://github.com/npm/npm-registry-fetch/issues/49 https://github.com/fent/node-ytdl-core/issues/859

JeffreytheCoder avatar Mar 13 '24 18:03 JeffreytheCoder