Back

only adding the 'ali-oss' node dependency and not referencin, Unable to execute function

  • 0
  • Self Hosted
  • Functions
wilhantian
3 Jun, 2023, 07:19

i use appwrite 1.3.6、function nodejs16.0

I created a default function using cli, only adding the 'ali-oss' node dependency and not referencing it in the JS file (declared only in package. json). After deploying the function, prompt after execution:

TL;DR
User is experiencing an error when adding the 'ali-oss' node dependency to their function. The error message suggests a TypeError. User is unsure how to view detailed operation logs. They provide a code snippet and mention that the error occurs at line 541 in a particular file. User mentions that the function still works despite the error. They are using Appwrite 1.3.6 and Node.js 16.0. Solution: It appears that the error is caused by not properly referencing the 'ali-oss' dependency in the JS file. Make sure to import and use the 'ali-oss' functions in your code.
wilhantian
3 Jun, 2023, 07:21

only adding the 'ali-oss' node dependency and not referencin, Unable to execute function

Bouahaza
3 Jun, 2023, 07:24

I've same error on all my function, but this havn't impact on function

Bouahaza
3 Jun, 2023, 07:24

If you run it, you'll see your JSON

Bouahaza
3 Jun, 2023, 07:30

But function works.. So I never search more. Perhaps @Steven have an idea..

wilhantian
3 Jun, 2023, 10:16

The function did not execute correctly, this line of code threw an error and stopped running

Drake
3 Jun, 2023, 14:40

What line?

wilhantian
4 Jun, 2023, 11:27

My English is not very good, there may be expression errors. You can create functions to reproduce the problem through the one I described above

wilhantian
4 Jun, 2023, 11:27

@Steven

Drake
5 Jun, 2023, 00:21

How did you deploy your function?

Drake
5 Jun, 2023, 01:00

ya...adding this library causes an error:

TypeScript
00:56:51 0|server  | TypeError: Cannot read properties of undefined (reading 'split')
00:56:51 0|server  |     at toIdentifier (/usr/local/src/node_modules/http-errors/index.js:257:14)
00:56:51 0|server  |     at forEachCode (/usr/local/src/node_modules/http-errors/index.js:228:16)
00:56:51 0|server  |     at Array.forEach (<anonymous>)
00:56:51 0|server  |     at populateConstructorExports (/usr/local/src/node_modules/http-errors/index.js:226:9)
00:56:51 0|server  |     at Object.<anonymous> (/usr/local/src/node_modules/http-errors/index.js:29:1)
00:56:51 0|server  |     at Module._compile (node:internal/modules/cjs/loader:1105:14)
00:56:51 0|server  |     at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
00:56:51 0|server  |     at Module.load (node:internal/modules/cjs/loader:981:32)
00:56:51 0|server  |     at Module._load (node:internal/modules/cjs/loader:827:12)
00:56:51 0|server  |     at Module.require (node:internal/modules/cjs/loader:1005:19)
Drake
5 Jun, 2023, 01:01

im not really sure why 🤷🏼‍♂️

wilhantian
14 Jun, 2023, 09:52

@Steven This issue has been bothering me for a long time. How can I view the detailed operation logs?

Drake
14 Jun, 2023, 17:38

You can try looking at the docker logs from the runtime container

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more