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

Undetermined nullability Encountered while compiling file:///.../postgrest_builder.dart, contains the type: NeverType(Never%). #1109

Open
karimegaber opened this issue Jan 13, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@karimegaber
Copy link

I am currently working on a Flutter Web app, when I added supabase_flutter package, I got this error:

Launching lib\main.dart on Chrome in debug mode...
Unhandled exception:
Unsupported operation: Undetermined nullability. Encountered while compiling file:///C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dev/postgrest-2.4.1/lib/src/postgrest_builder.dart, which contains the type: NeverType(Never%).
#0      ProgramCompiler._typeCompilationError (package:dev_compiler/src/kernel/compiler.dart:3678)
#1      ProgramCompiler._newEmitType (package:dev_compiler/src/kernel/compiler.dart:3471)
#2      ProgramCompiler._emitType (package:dev_compiler/src/kernel/compiler.dart:3379)
#3      MappedListIterable.elementAt (dart:_internal/iterable.dart:425)
#4      MappedListIterable.elementAt (dart:_internal/iterable.dart:425)
#5      ListIterator.moveNext (dart:_internal/iterable.dart:354)
#6      InstantiatorGeneratorVisitor.splayNodes (package:dev_compiler/src/js_ast/template.dart:224)
#7      InstantiatorGeneratorVisitor.handleCallOrNew.<anonymous closure> (package:dev_compiler/src/js_ast/template.dart:604)
#8      Template.instantiate (package:dev_compiler/src/js_ast/template.dart:118)
#9      JsBuilder.call (package:dev_compiler/src/js_ast/builder.dart:212)
#10     ProgramCompiler._emitGenericClassType (package:dev_compiler/src/kernel/compiler.dart:3717)
#11     ProgramCompiler._emitClassRef (package:dev_compiler/src/kernel/compiler.dart:3634)
#12     ProgramCompiler._emitConstructorName (package:dev_compiler/src/kernel/compiler.dart:3869)
#13     ProgramCompiler.visitConstructorInvocation (package:dev_compiler/src/kernel/compiler.dart:7058)
#14     ConstructorInvocation.accept (package:kernel/ast.dart:6660)
#15     ProgramCompiler._visitExpression (package:dev_compiler/src/kernel/compiler.dart:4611)
#16     ProgramCompiler.visitReturnStatement (package:dev_compiler/src/kernel/compiler.dart:5182)
#17     ReturnStatement.accept (package:kernel/ast.dart:10159)
#18     ProgramCompiler._visitStatement (package:dev_compiler/src/kernel/compiler.dart:4520)
#19     MappedListIterable.elementAt (dart:_internal/iterable.dart:425)
#20     ListIterator.moveNext (dart:_internal/iterable.dart:354)
#21     new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189)
#22     new _GrowableList.of (dart:core-patch/growable_array.dart:150)
#23     new List.of (dart:core-patch/array_patch.dart:39)
#24     SetBase.toList (dart:collection/set.dart:119)
#25     ProgramCompiler.visitBlock (package:dev_compiler/src/kernel/compiler.dart:4701)
#26     Block.accept (package:kernel/ast.dart:9195)
#27     ProgramCompiler._visitStatement (package:dev_compiler/src/kernel/compiler.dart:4520)
#28     ProgramCompiler._emitFunctionScopedBody (package:dev_compiler/src/kernel/compiler.dart:4553)
#29     ProgramCompiler._emitSyncFunctionBody.<anonymous closure> (package:dev_compiler/src/kernel/compiler.dart:4259)
#30     ProgramCompiler._withLetScope (package:dev_compiler/src/kernel/compiler.dart:2829)
#31     ProgramCompiler._withCurrentFunction (package:dev_compiler/src/kernel/compiler.dart:4296)
#32     ProgramCompiler._emitSyncFunctionBody (package:dev_compiler/src/kernel/compiler.dart:4255)
#33     ProgramCompiler._emitFunction (package:dev_compiler/src/kernel/compiler.dart:4060)
#34     ProgramCompiler._emitMethodDeclaration.<anonymous closure> (package:dev_compiler/src/kernel/compiler.dart:2392)
#35     ProgramCompiler._withMethodDeclarationContext (package:dev_compiler/src/kernel/compiler.dart:4323)
#36     ProgramCompiler._emitMethodDeclaration (package:dev_compiler/src/kernel/compiler.dart:2391)
#37     ProgramCompiler._emitClassMethods (package:dev_compiler/src/kernel/compiler.dart:2332)
#38     ProgramCompiler._emitClassDeclaration (package:dev_compiler/src/kernel/compiler.dart:932)
#39     ProgramCompiler._emitClass (package:dev_compiler/src/kernel/compiler.dart:846)
#40     ProgramCompiler._declareBeforeUse (package:dev_compiler/src/kernel/compiler.dart:876)
#41     ProgramCompiler._emitInterfaceType (package:dev_compiler/src/kernel/compiler.dart:3531)
#42     ProgramCompiler._defineClass.emitClassRef (package:dev_compiler/src/kernel/compiler.dart:1355)
#43     ProgramCompiler._defineClass (package:dev_compiler/src/kernel/compiler.dart:1444)
#44     ProgramCompiler._emitClassDeclaration (package:dev_compiler/src/kernel/compiler.dart:941)
#45     ProgramCompiler._emitClass (package:dev_compiler/src/kernel/compiler.dart:846)
#46     ProgramCompiler._declareBeforeUse (package:dev_compiler/src/kernel/compiler.dart:876)
#47     ProgramCompiler._emitInterfaceType (package:dev_compiler/src/kernel/compiler.dart:3531)
#48     ProgramCompiler._defineClass.emitClassRef (package:dev_compiler/src/kernel/compiler.dart:1355)
#49     ProgramCompiler._defineClass (package:dev_compiler/src/kernel/compiler.dart:1444)
#50     ProgramCompiler._emitClassDeclaration (package:dev_compiler/src/kernel/compiler.dart:941)
#51     ProgramCompiler._emitClass (package:dev_compiler/src/kernel/compiler.dart:846)
#52     List.forEach (dart:core-patch/growable_array.dart:416)
#53     ProgramCompiler._emitLibrary (package:dev_compiler/src/kernel/compiler.dart:784)
#54     List.forEach (dart:core-patch/growable_array.dart:416)
#55     ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:505)
#56     IncrementalJavaScriptBundler.compile (package:frontend_server/src/javascript_bundle.dart:223)
#57     FrontendCompiler.writeJavaScriptBundle (package:frontend_server/frontend_server.dart:794)
<asynchronous suspension>
#58     FrontendCompiler.compile (package:frontend_server/frontend_server.dart:654)
<asynchronous suspension>
#59     listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1303)
<asynchronous suspension>
Failed to compile application.


Exited (1).

My Code:

class AppSupabaseClient {
  // Client Instance
  SupabaseClient get supabase => Supabase.instance.client;

  // Initialization
  static Future<void> init() async {
    await Supabase.initialize(
      url: Env.supabaseUrl,
      anonKey: Env.supabaseAnonKey,
    );
  }
}

My Versions
Flutter : Flutter 3.19.1
Dart: Dart 3.3.0
Supabase: supabase_flutter: ^2.8.3

Flutter Doctor
[√] Flutter (Channel stable, 3.19.1, on Microsoft Windows [Version 10.0.22621.4317], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.6.1)
[√] Android Studio (version 2023.1)
[√] IntelliJ IDEA Community Edition (version 2023.1)
[√] VS Code (version 1.96.2)
[√] Connected device (3 available)
[√] Network resources

• No issues found!

@karimegaber karimegaber added the bug Something isn't working label Jan 13, 2025
@karimegaber karimegaber changed the title Undetermined nullability Undetermined nullability Encountered while compiling file:///.../postgrest_builder.dart, contains the type: NeverType(Never%). Jan 13, 2025
@dshukertjr
Copy link
Member

I'm guessing this is a bug introduced in Flutter.

@karimegaber
Copy link
Author

I'm guessing this is a bug introduced in Flutter.

Can you please clarify more ?

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

No branches or pull requests

2 participants