imaNNeo / fl_chart

FL Chart is a highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
https://flchart.dev
MIT License
6.8k stars 1.76k forks source link

NativeJavaScriptObject Error BindingError: Tried to invoke ctor of Path with invalid number of parameters (1) - expected (0) parameters instead! #561

Closed rguntha closed 3 years ago

rguntha commented 3 years ago

The below error is happening while using the LineChart in flutter web.

======== Exception caught by rendering library =====================================================
The following NativeJavaScriptObject object was thrown during paint():
  BindingError: Tried to invoke ctor of Path with invalid number of parameters (1) - expected (0) parameters instead!

When the exception was thrown, this was the stack: 
https://unpkg.com/canvaskit-wasm@0.22.0/bin/canvaskit.js 153:76        <fn>
https://unpkg.com/canvaskit-wasm@0.22.0/bin/canvaskit.js 152:335       new BindingError
https://unpkg.com/canvaskit-wasm@0.22.0/bin/canvaskit.js 206:164       <fn>
https://unpkg.com/canvaskit-wasm@0.22.0/bin/canvaskit.js 152:335       new Path
lib/_engine/engine/canvaskit/path.dart 16:15                           from
...
The following RenderObject was being processed when the exception was fired: RenderCustomPaint#fc56b
...  parentData: <none> (can use size)
...  constraints: BoxConstraints(w=300.0, h=200.0)
...  size: Size(300.0, 200.0)
RenderObject: RenderCustomPaint#fc56b
  parentData: <none> (can use size)
  constraints: BoxConstraints(w=300.0, h=200.0)
  size: Size(300.0, 200.0)
==================================================================================================

To Reproduce I am just using the LineChartSample6 from https://github.com/imaNNeoFighT/fl_chart/blob/master/example/lib/line_chart/samples/line_chart_sample6.dart in a StatefulWidget widget by itself.

The UI renders the chart background but the line is not drawn.

Versions Flutter Doctor Output: [✓] Flutter (Channel master, 1.26.0-13.0.pre.44, on Mac OS X 10.15.7 19H114 darwin-x64, locale en-IN) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✗] Xcode - develop for iOS and macOS ✗ Xcode installation is incomplete; a full installation is necessary for iOS development. Download at: https://developer.apple.com/xcode/download/ Or install Xcode via the App Store. Once installed, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer sudo xcodebuild -runFirstLaunch ✗ CocoaPods not installed. CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side. Without CocoaPods, plugins will not work on iOS or macOS. For more info, see https://flutter.dev/platform-plugins To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions. [✓] Chrome - develop for the web [✓] Android Studio (version 4.1) [✓] IntelliJ IDEA Ultimate Edition (version 2020.3) [✓] Connected device (2 available)

FlChart Version: fl_chart: ^0.12.2

skateboarder commented 3 years ago

Are you using the auto-hot-reload functionality ?

I've noticed that those errors come up when hot-reloading while I'm editing the sample, but once I'm done editing the sample, and then hot-reload, there are no uncaught exceptions.

rguntha commented 3 years ago

This issue is happening even when I do 'flutter clean' and relaunch the app in debug mode.

======== Exception caught by rendering library

BindingError: Tried to invoke ctor of Path with invalid number of parameters (1) - expected (0) parameters instead!

Please resolve this issue quickly. Otherwise, I am forced do change my code to integrate with another chart functionality. I want to avoid additional work.

It was working fine until now. I am not sure if the new flutter version is causing any issues.

Thanks Ramesh

On Wed, Feb 3, 2021, 7:17 AM skateboarder notifications@github.com wrote:

Are you using the auto-hot-reload functionality ?

I've noticed that those errors come up when hot-reloading while I'm editing the sample, but once I'm done editing the sample, and then hot-reload, there are no uncaught exceptions.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/imaNNeoFighT/fl_chart/issues/561#issuecomment-772145803, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2WSBJ7MTAF6LUVVFWVHC3S5CTKBANCNFSM4W2GYA2A .

Ronjack commented 3 years ago

same error

Ronjack commented 3 years ago

This issue is happening even when I do 'flutter clean' and relaunch the app in debug mode. ======== Exception caught by rendering library ===================================================== BindingError: Tried to invoke ctor of Path with invalid number of parameters (1) - expected (0) parameters instead! Please resolve this issue quickly. Otherwise, I am forced do change my code to integrate with another chart functionality. I want to avoid additional work. It was working fine until now. I am not sure if the new flutter version is causing any issues. Thanks Ramesh On Wed, Feb 3, 2021, 7:17 AM skateboarder @.**> wrote: Are you using the auto-hot-reload functionality ? I've noticed that those errors come up when hot-reloading while I'm editing the sample, but once I'm done editing the sample, and then* hot-reload, there are no uncaught exceptions. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#561 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2WSBJ7MTAF6LUVVFWVHC3S5CTKBANCNFSM4W2GYA2A .

Hey! I changed from dev channel to beta channel and its working, so maybe its a temporary fix for u.

rguntha commented 3 years ago

Thanks very much Ronjack. It works in beta channel.

But I need it to work in the master channel, as some otherthings broke in other channels (especially the flutter web parts)

Thanks Ramesh

On Thu, Feb 4, 2021 at 2:13 PM Ronjack notifications@github.com wrote:

This issue is happening even when I do 'flutter clean' and relaunch the app in debug mode. ======== Exception caught by rendering library ===================================================== BindingError: Tried to invoke ctor of Path with invalid number of parameters (1) - expected (0) parameters instead! Please resolve this issue quickly. Otherwise, I am forced do change my code to integrate with another chart functionality. I want to avoid additional work. It was working fine until now. I am not sure if the new flutter version is causing any issues. Thanks Ramesh … <#m-5396034890223548248> On Wed, Feb 3, 2021, 7:17 AM skateboarder @.**> wrote: Are you using the auto-hot-reload functionality ? I've noticed that those errors come up when hot-reloading while I'm editing the sample, but once I'm done editing the sample, and then* hot-reload, there are no uncaught exceptions. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#561 (comment) https://github.com/imaNNeoFighT/fl_chart/issues/561#issuecomment-772145803>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2WSBJ7MTAF6LUVVFWVHC3S5CTKBANCNFSM4W2GYA2A .

Hey! I changed from dev channel to beta channel and its working, so maybe its a temporary fix for u.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/imaNNeoFighT/fl_chart/issues/561#issuecomment-773135407, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2WSBNMEROLXCTZIRBGYZ3S5JM3VANCNFSM4W2GYA2A .

-- Ramesh Guntha

emmett-deen commented 3 years ago

On the latest version of flutter beta today and having this error.

Flutter 1.26.0-17.2.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 79b49b9e10 (24 hours ago) • 2021-02-03 15:33:39 -0800
Engine • revision 2c527d6c7e
Tools • Dart 2.12.0 (build 2.12.0-259.8.beta)

edit: I am also getting this error on the master branch which means this can't really be used with Flutter Web at all. This should definitely be a high priority bug.

Flutter 1.26.0-18.0.pre.204 • channel master • https://github.com/flutter/flutter.git
Framework • revision a76cc2e7c0 (16 minutes ago) • 2021-02-04 15:42:48 -0800
Engine • revision 8076607c3e
Tools • Dart 2.12.0 (build 2.12.0-286.0.dev)
emmett-deen commented 3 years ago

Update here, this is specifically an issue when using canvaskit as the rendering engine. I imagine some update with the canvaskit flutter web integration is causing this issue and needs to be visited. Obviously should be fixed so we can continue using this rendering engine when preferred, but a workaround to continue development on your project would be to run with the HTML rendering engine: flutter run -d chrome --web-renderer html

emmett-deen commented 3 years ago

Did some digging and it does seem to be an issue specifically with Flutter's CanvasKit implementation so I opened an issue here: https://github.com/flutter/flutter/issues/75473 please go and give it a thumbs up if you are having this issue!

kengreg commented 3 years ago

Hello I am having the same problem here. I am trying to make the app for web and it doesnt work even if I use the examples of linechart showed in the docs. The plugin works find for ios/android as an app but when I export it or see in safari or chrome it always show the same error image

do you think that there will be any solution for this?

dnkoulouris commented 3 years ago

same problem here. when running with html, its fine, but when run with canvaskit, error thrown

emmett-deen commented 3 years ago

@kengreg @denkoul this is not a fl_chart issue this is a flutter engine issue. I have opened an issue here: https://github.com/flutter/flutter/issues/75473 please leave a thumbs up so they get to fixing it faster!

kaumudpa commented 3 years ago

@emmett-deen Somebody from the flutter team closed this issue mentioning a fix but it seems like the fix is still not there on the master channel.

kaumudpa commented 3 years ago

This fix is landed on the master channel of flutter, I think it will take some time before it lands in Dev and Beta.

jlubeck commented 3 years ago

Just jumping on the bandwagon to be notified when anyone sees this working on Dev or Beta. I'll do the same on my end if/when I see it and this hasn't been updated yet so we can close this issue

jlubeck commented 3 years ago

I just successfully tested on latest dev channel that was released today Flutter 2.1.0-10.0.pre • channel dev

Beta is currently the same as stable and the fix is not there yet.

kaumudpa commented 3 years ago

The fix has landed in beta channel. - 2.1.0-12.2.pre

imaNNeo commented 3 years ago

The fix has landed in stable channel 2.0.3. If you see any problem again please let me know. Thanks!