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

🐛 Bug Report: Unhandled Exception: type 'Null' is not a subtype of type 'List<dynamic>' #173

Closed
2 tasks done
jtmuller5 opened this issue Sep 10, 2023 · 8 comments · Fixed by appwrite/sdk-generator#751
Assignees
Labels
bug Something isn't working

Comments

@jtmuller5
Copy link

👟 Reproduction steps

I see an error when trying to create a new account:

E/flutter (14287): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'Null' is not a subtype of type 'List<dynamic>'
E/flutter (14287): #0      new User.fromMap (package:appwrite/src/models/user.dart:87:18)
E/flutter (14287): #1      Account.create (package:appwrite/services/account.dart:57:24)
E/flutter (14287): <asynchronous suspension>
E/flutter (14287): #2      AppwriteService.createEmailAccount (package:appwrite_auth_ui/src/components/services/appwrite_service.dart:81:19)
E/flutter (14287): <asynchronous suspension>
E/flutter (14287): #3      AppwriteSignupState.onSignup (package:appwrite_auth_ui/src/components/screens/signup/signup.dart:29:43)
E/flutter (14287): <asynchronous suspension>
E/flutter (14287): 

Apparently the "labels" property is required in the User model but its not returned by the create() method.

👍 Expected behavior

Don't require the labels property on the User model or return the labels list in the create response.

👎 Actual Behavior

An error is thrown

🎲 Appwrite version

Version 2.0.x

💻 Operating system

MacOS

🧱 Your Environment

Basic Flutter app in Android studio. Running on emulator

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@jtmuller5 jtmuller5 added the bug Something isn't working label Sep 10, 2023
@jtmuller5 jtmuller5 changed the title 🐛 Bug Report: 🐛 Bug Report: Unhandled Exception: type 'Null' is not a subtype of type 'List<dynamic>' Sep 10, 2023
@stnguyen90
Copy link
Contributor

@jtmuller5, thanks for creating this issue! 🙏🏼 What version of Appwrite are you on?

@stnguyen90 stnguyen90 self-assigned this Sep 12, 2023
@jtmuller5
Copy link
Author

Hi, I am using version 11.0.0 of the appwrite package on pub dev. I haven't made any other changes to my appwrite setup.

@stnguyen90
Copy link
Contributor

@jtmuller5 Sorry, I meant what version of the Appwrite server?

@jtmuller5
Copy link
Author

It looks like the project is using v 1.1.2. I set it up using the "Get Started" button in Appwrite cloud. Is there a way to upgrade this?

@stnguyen90
Copy link
Contributor

@jtmuller5, Appwrite Cloud is using 1.1.2. The Appwrite team will be upgrading Appwrite Cloud soon.

The SDK you're attempting to use (11.0.0) is meant for Appwrite 1.4.x, which is why you're getting the error.

image

For Appwrite Cloud (on 1.1.2), please try version 8.1.0 of the Appwrite Flutter SDK.

@FaisalMohammadi
Copy link

i have the same issue when i try to do Query.Select in listDocuments.
I am using flutter sdk 11.0.1 and my appwrite instance is 1.4.11

@Weav3r
Copy link

Weav3r commented Dec 13, 2023

Same issue.
sdk: 11.0.1
appwrite: 1.4.13

It works for a single document i.e db.getDocument(...)
P.S. cli works, rest works and apparently graphql also works

@iaggocapitanio1
Copy link

having the same issue, is a problem in the serialization processs, the labels field in the creation is null but it's defines as List .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants