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

Building for Web #59

Closed
KieranLafferty opened this issue Jul 20, 2020 · 11 comments
Closed

Building for Web #59

KieranLafferty opened this issue Jul 20, 2020 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@KieranLafferty
Copy link
Contributor

KieranLafferty commented Jul 20, 2020

When building via flutter run -d chrome --verbose web I get the following:

[        ] ../../../../.pub-cache/hosted/pub.dartlang.org/moor_ffi-0.5.0/lib/src/bindings/types.dart:6:8: Error: Not found: 'dart:ffi'
[        ] import 'dart:ffi';
[        ]        ^
[   +3 ms] ../../../../.pub-cache/hosted/pub.dartlang.org/moor_ffi-0.5.0/lib/src/impl/database.dart:2:8: Error: Not found: 'dart:ffi'
[        ] import 'dart:ffi';
[        ]        ^
[        ] ../../../../.pub-cache/hosted/pub.dartlang.org/moor_ffi-0.5.0/lib/src/ffi/blob.dart:2:8: Error: Not found: 'dart:ffi'
[        ] import 'dart:ffi';
[        ]        ^
[        ] ../../../../.pub-cache/hosted/pub.dartlang.org/moor_ffi-0.5.0/lib/src/ffi/utils.dart:1:8: Error: Not found: 'dart:ffi'
[        ] import 'dart:ffi';
[        ]        ^
[        ] ../../../../.pub-cache/hosted/pub.dartlang.org/moor_ffi-0.5.0/lib/src/bindings/bindings.dart:5:8: Error: Not found: 'dart:ffi'
[        ] import 'dart:ffi';
[        ]        ^
[   +1 ms] ../../../../.pub-cache/hosted/pub.dartlang.org/moor_ffi-0.5.0/lib/src/bindings/signatures.dart:5:8: Error: Not found: 'dart:ffi'
[        ] import 'dart:ffi';
[        ]        ^
[  +64 ms] ../../../../.pub-cache/hosted/pub.dartlang.org/moor_ffi-0.5.0/lib/open_helper.dart:5:8: Error: Not found: 'dart:ffi'
[        ] import 'dart:ffi';
...

I've tried various things from this repository to try and get it working with no success https://github.com/rodydavis/moor_shared

Could you please provide a sample web target for this project to get started with this on Web?

gz#4510

@shodgetts
Copy link

Agent comment from Séni Gueye in Zendesk ticket #4510:

Hi,

Thanks for getting in touch.
I'm passing this on to our Flutter development team for more insights.
We'll get back to you shortly.

Best regards,
Seni

@imtoori
Copy link
Contributor

imtoori commented Jul 20, 2020

Hi @KieranLafferty,
I'm sorry but at the moment we have no example on Web.
The biggest problem right now is the moor library: we need to implement the web part, but I didn't look into that yet.
The good news is that web support it's in our backlog, we'll keep you updated

@imtoori imtoori added the enhancement New feature or request label Jul 20, 2020
@KieranLafferty
Copy link
Contributor Author

thanks @imtoori this repo has a working example of moor on web/ios/android/mac/windows/linux if you need a reference point https://github.com/rodydavis/moor_shared

@shodgetts
Copy link

Agent comment from Stephen Hodgetts in Zendesk ticket #4510:

Closing ZD ticket, feature request

@KieranLafferty
Copy link
Contributor Author

KieranLafferty commented Jul 22, 2020

Just a follow up to this. I've found that simply including stream_chat_flutter as a dependency in my project breaks the entire project's ability to build/run on flutter web. Even if adding web support isn't something that will happen soon could you fix the build issues that arise from including this as a dependency on web

here's the error I get when building for web

Launching lib/main.dart on Chrome in debug mode...
Unhandled exception:
InvalidType doesn't have nullability.
#0      InvalidType.nullability  (package:kernel/ast.dart:6750:34)
#1      ProgramCompiler._mustBeNonNullable  (package:dev_compiler/src/kernel/compiler.dart:3145:14)

#2      ProgramCompiler._emitArgumentInitializers.initParameter  (package:dev_compiler/src/kernel/compiler.dart:3185:18)
#3      ProgramCompiler._emitArgumentInitializers  (package:dev_compiler/src/kernel/compiler.dart:3207:20)
#4      ProgramCompiler._emitConstructorBody  (package:dev_compiler/src/kernel/compiler.dart:1369:16)
#5      ProgramCompiler._emitConstructor.<anonymous closure>.<anonymous closure>  (package:dev_compiler/src/kernel/compiler.dart:1349:19)
#6      ProgramCompiler._superDisallowed  (package:dev_compiler/src/kernel/compiler.dart:3138:24)

#7      ProgramCompiler._emitConstructor.<anonymous closure>  (package:dev_compiler/src/kernel/compiler.dart:1348:15)

@imtoori
Copy link
Contributor

imtoori commented Jul 28, 2020

@KieranLafferty I'll try to do it, but it's not our first priority given that Flutter web is still in beta

@deven98 deven98 self-assigned this Oct 8, 2020
@imtoori
Copy link
Contributor

imtoori commented Oct 16, 2020

Closing this since now the SDK builds on for web

@imtoori imtoori closed this as completed Oct 16, 2020
@rohan20
Copy link

rohan20 commented Feb 22, 2021

@imtoori Can you please help figure out what I may be doing incorrectly? I have issues with moor on web and hence setUser fails.

image

I'm on stream_chat_flutter: ^0.2.21. I know stream_chat_flutter isn't compatible with Web but I assume that's only for the UI part? setUser should still work I suppose. Or should I use stream_chat_flutter_core even for setUser?

Thanks.

@imtoori
Copy link
Contributor

imtoori commented Feb 22, 2021

@rohan20 check out this section of the readme https://github.com/GetStream/stream-chat-flutter/tree/master/packages/stream_chat_persistence#flutter-web

I think this should work, even using the higher level package

@rohan20
Copy link

rohan20 commented Feb 22, 2021

@imtoori Perfect! Thank you.

I also ended up using this to fetch the 2 files instead of getting them from the release: https://github.com/rodydavis/moor_shared

@goxiaoy
Copy link

goxiaoy commented Apr 10, 2021

The latest sdk version

  stream_chat_flutter: ^1.5.2
  stream_chat_persistence: ^1.5.1

break again in web

../../development/flutter/.pub-cache/hosted/pub.dartlang.org/moor-3.4.0/lib/src/ffi/database_tracker.dart:1:8: Error: Not found: 'dart:ffi'
import 'dart:ffi';
       ^
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/sqlite3-0.1.8/lib/src/api/database.dart:1:8: Error: Not found: 'dart:ffi'
import 'dart:ffi';
       ^
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/sqlite3-0.1.8/lib/src/api/sqlite3.dart:1:8: Error: Not found: 'dart:ffi'
import 'dart:ffi';
       ^
../../development/flutter/.pub-cache/hosted/pub.dartlang.org/sqlite3-0.1.8/lib/src/api/statement.dart:1:8: Error: Not found: 'dart:ffi'
import 'dart:ffi';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants