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

Fix "unexpected end of file" error #599

Merged
merged 1 commit into from
Dec 29, 2022

Conversation

stnguyen90
Copy link
Contributor

What does this PR do?

Some API calls result in an error like:

Error: unexpected end of file
    at Client.call (.../appwrite-playground-for-node/node_modules/node-appwrite/lib/client.js:176:23)
    at processTicksAndRejections (.../appwrite-playground-for-node/lib/internal/process/task_queues.js:96:5)
    at async Databases.listCollections (.../appwrite-playground-for-node/node_modules/node-appwrite/lib/services/databases.js:186:16)
    at async listCollections (.../appwrite-playground-for-node/src/app.js:135:22)
    at async runAllTasks (.../appwrite-playground-for-node/src/app.js:504:5) {code: undefined, type: undefined, response: undefined, stack: 'Error: unexpected end of file
    at Client.c…ppwrite-playground-for-node/src/app.js:504:5)', message: 'unexpected end of file'}

This appears to be a bug in axios. See https://stackoverflow.com/questions/74779161/why-axios-returns-z-buf-error. This workaround adds a header that works around the problem.

Test Plan

Manually tested with the playground for node.

Related PRs and Issues

None

Have you read the Contributing Guidelines on issues?

Yes

@stnguyen90 stnguyen90 added the lang-node NodeJS templates label Dec 28, 2022
@lohanidamodar lohanidamodar merged commit 04a3378 into master Dec 29, 2022
@lohanidamodar lohanidamodar deleted the fix-node-sdk-encoding-error branch December 29, 2022 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-node NodeJS templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants