dint-dev / universal_html

Cross-platform 'dart:html'.
https://pub.dev/packages/universal_html
Apache License 2.0
201 stars 60 forks source link

universal_html-2.2.2/lib/src/html/dom/element_subclasses.dart:2752:30: Error: The argument type 'String?' can't be assigned to the parameter type 'Object' because 'String?' is nullable and 'Object' isn't. - 'Object' is from 'dart:core'. #76

Closed danuprakoso26 closed 1 year ago

danuprakoso26 commented 1 year ago

this happens on universal html v2.2.2 and flutter sdk 3.10.0. I tried to downgrade to 3.7.12 but still the same.

image

4dcity commented 1 year ago

My flutter version is 3.7.7,I got the same error it worked fine yesterday,have no idea what change casued this error...

raghavsatyadev commented 1 year ago

@danuprakoso26 @4dcity include this dependency in your pubspec.yaml. Yesterday a new version was released for this lib and it broke universal_html. This will limit the csslib to be of old version instead of always updating whenever there is a new version

csslib: 0.17.0

danuprakoso26 commented 1 year ago

@danuprakoso26 @4dcity include this dependency in your pubspec.yaml. Yesterday a new version was released for this lib and it broke universal_html. This will limit the csslib to be of old version instead of always updating whenever there is a new version csslib: 0.17.0

oh wow. what a life saver. thank you

4dcity commented 1 year ago

@raghavsatyadev problem solved!thanks a lot! hope the project maintainer can fix this in a newer version

ashish-d-hh commented 1 year ago

Thanks

mrcsh commented 1 year ago

@raghavsatyadev Ugh, I spent hours yesterday trying to figure out why my release branch would not build but my dev branch would. I would have eventually found it but many thanks for the short cut. Also I had other deps on csslib that needed 0.17.2 which also works.

UsamaSarwar commented 1 year ago

I solved this issue after so many hours. Here is the PR with patched fix. https://github.com/dint-dev/universal_html/pull/75

abdorizak commented 1 year ago

@danuprakoso26 @4dcity include this dependency in your pubspec.yaml. Yesterday a new version was released for this lib and it broke universal_html. This will limit the csslib to be of old version instead of always updating whenever there is a new version

csslib: 0.17.0

I really appreciate your solution @raghavsatyadev, but i think this will be temporary fix need to fix from code that cause null string please owners should review this PR #75 and urgently merge. thanks @UsamaSarwar

sarthak-grappus commented 1 year ago

we arent even using it and getting the error and that too at client side 😤

89pleasure commented 1 year ago

still does not work

VenkataRaoRayala commented 1 year ago

Hi all, just downloaded this plugin code, at [universal_html-2.2.2/lib/src/html/dom/element_subclasses.dart:2752] you missed to add ! to text object. I am using flutter 3.1.0. Error got resolved.

change this final parsed = css.parse(text);
to this final parsed = css.parse(text!);

and also please update all the packages to latest in pubpect.yaml file

Please publish this change, it will help us a lot!!!!

Octavian25 commented 1 year ago

Hi all, just downloaded this plugin code, at [universal_html-2.2.2/lib/src/html/dom/element_subclasses.dart:2752] you missed to add ! to text object. I am using flutter 3.1.0. Error got resolved.

change this final parsed = css.parse(text); to this final parsed = css.parse(text!);

and also please update all the packages to latest in pubpect.yaml file

Please publish this change, it will help us a lot!!!!

Thank you very much, this change has been extremely helpful and works well. I kindly request the developers to publish these changes.

RoyalCoder88 commented 1 year ago

Please fix this issue, have the same issue :(

Launching lib\main.dart on SM A908B in debug mode...
../../../AppData/Local/Pub/Cache/hosted/pub.dev/universal_html-2.2.2/lib/src/html/dom/element_subclasses.dart:2752:30: Error: The argument type 'String?' can't be assigned to the parameter type 'Object' because 'String?' is nullable and 'Object' isn't.
 - 'Object' is from 'dart:core'.
    final parsed = css.parse(text);
                             ^
Target kernel_snapshot failed: Exception

> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 37s
Running Gradle task 'assembleDebug'...                             38.8s
Exception: Gradle task assembleDebug failed with exit code 1

Thanks in advance!

Mike-3 commented 1 year ago

I have the same exception.

samumzizi commented 1 year ago

Yes, this is what I did too (adding the exclamation mark) and it worked.

rymesaint commented 1 year ago

i have the same problem after upgraded the flutter

Morpa commented 1 year ago

Here the same problem is happening. Even updating to the latest version. I saw that the csslib is already with the version 0.17.3

brux88 commented 1 year ago

i have the same problem

iameerhamza commented 1 year ago

@danuprakoso26 @4dcity include this dependency in your pubspec.yaml. Yesterday a new version was released for this lib and it broke universal_html. This will limit the csslib to be of old version instead of always updating whenever there is a new version

csslib: 0.17.0

it didnt work while building app for ios

raghavsatyadev commented 1 year ago

@danuprakoso26 @4dcity include this dependency in your pubspec.yaml. Yesterday a new version was released for this lib and it broke universal_html. This will limit the csslib to be of old version instead of always updating whenever there is a new version csslib: 0.17.0

it didnt work while building app for ios

May be some other dependency is causing the issue on your side as we have successfully made the builds and pushed

adrianvintu commented 1 year ago

The fix for me was:

dependency_overrides:
  csslib: 0.17.0
  universal_html: 2.0.8

I do not use csslib, but the override is needed.

The 2.0.8 verson number I got from searching for "universal_html" in all pubspec.yaml from the folder c:\Users\<username>\AppData\Local\Pub\Cache\hosted\pub.dev\

There was a single result
c:\Users\<username>\AppData\Local\Pub\Cache\hosted\pub.dev\flick_video_player-0.5.0\pubspec.yaml using universal_html: ^2.0.8

mftlhn commented 1 year ago

Hi all, just downloaded this plugin code, at [universal_html-2.2.2/lib/src/html/dom/element_subclasses.dart:2752] you missed to add ! to text object. I am using flutter 3.1.0. Error got resolved.

change this final parsed = css.parse(text); to this final parsed = css.parse(text!);

and also please update all the packages to latest in pubpect.yaml file

Please publish this change, it will help us a lot!!!!

thanks. it's extremely helpful

raghavsatyadev commented 1 year ago

@danuprakoso26 this issue is now resolved with 2.2.3 version, I think we should close this

ErnestGaisieViuHealth commented 9 months ago

@danuprakoso26 @4dcity include this dependency in your pubspec.yaml. Yesterday a new version was released for this lib and it broke universal_html. This will limit the csslib to be of old version instead of always updating whenever there is a new version

csslib: 0.17.0

Thanks soo much. I've been facing this issue for days. Thumbs up 👍

shanaka-sync commented 9 months ago

The fix for me was:

dependency_overrides:
  csslib: 0.17.0
  universal_html: 2.0.8

I do not use csslib, but the override is needed.

The 2.0.8 verson number I got from searching for "universal_html" in all pubspec.yaml from the folder c:\Users\<username>\AppData\Local\Pub\Cache\hosted\pub.dev\

There was a single result c:\Users\<username>\AppData\Local\Pub\Cache\hosted\pub.dev\flick_video_player-0.5.0\pubspec.yaml using universal_html: ^2.0.8

Thankx dude, This works for me.