bosskmk / pluto_grid

PlutoGrid is a dataGrid for flutter that can be controlled by the keyboard on desktop and web. Of course, it works well on Android and IOS.
https://pluto.weblaze.dev
MIT License
636 stars 290 forks source link

[Bug] deployerror #978

Closed hiromumachi closed 6 months ago

hiromumachi commented 7 months ago

The following error occurs during deployment in a web app. The error message is as follows:

../../../.pub-cache/hosted/pub.dev/pluto_grid-7.0.2/lib/src/manager/shortcut/pluto_grid_shortcut.dart:33:39:
Error: The argument type 'RawKeyEvent' can't be assigned to the parameter type 'KeyEvent'.
 - 'RawKeyEvent' is from 'package:flutter/src/services/raw_keyboard.dart' ('flutter/packages/flutter/lib/src/services/raw_keyboard.dart').
 - 'KeyEvent' is from 'package:flutter/src/services/hardware_keyboard.dart' ('flutter/packages/flutter/lib/src/services/hardware_keyboard.dart').
      if (action.key.accepts(keyEvent.event, state)) ***
                                      ^
../../../.pub-cache/hosted/pub.dev/pluto_grid-7.0.2/lib/src/manager/shortcut/pluto_grid_shortcut.dart:33:46:
Error: The argument type 'RawKeyboard' can't be assigned to the parameter type 'HardwareKeyboard'.
 - 'RawKeyboard' is from 'package:flutter/src/services/raw_keyboard.dart' ('flutter/packages/flutter/lib/src/services/raw_keyboard.dart').
 - 'HardwareKeyboard' is from 'package:flutter/src/services/hardware_keyboard.dart' ('flutter/packages/flutter/lib/src/services/hardware_keyboard.dart').
      if (action.key.accepts(keyEvent.event, state)) ***

Is the .pub-cache unrelated to this issue? I'm confused by this sudden error.

freddydrodev commented 7 months ago

I got error while deploying on vercel too. I think it is about the dart version, I am using

environment:
  sdk: ">=3.1.3 <4.0.0"

While in your example you have been using

environment:
  sdk: ">=2.17.0 <3.0.0"

ISSUE

[13:40:45.507] Compiling lib/main.dart for the Web...                          
[13:40:45.508] Target dart2js failed: ProcessException: Process exited abnormally with exit code 1:
[13:40:45.508] ../.pub-cache/hosted/pub.dev/pluto_grid-7.0.2/lib/src/manager/shortcut/pluto_grid_shortcut.dart:33:39:
[13:40:45.509] Error: The argument type 'RawKeyEvent' can't be assigned to the parameter type 'KeyEvent'.
[13:40:45.509]  - 'RawKeyEvent' is from 'package:flutter/src/services/raw_keyboard.dart' ('flutter/packages/flutter/lib/src/services/raw_keyboard.dart').
[13:40:45.509]  - 'KeyEvent' is from 'package:flutter/src/services/hardware_keyboard.dart' ('flutter/packages/flutter/lib/src/services/hardware_keyboard.dart').
[13:40:45.509]       if (action.key.accepts(keyEvent.event, state)) {
[13:40:45.509]                                       ^
[13:40:45.509] ../.pub-cache/hosted/pub.dev/pluto_grid-7.0.2/lib/src/manager/shortcut/pluto_grid_shortcut.dart:33:46:
[13:40:45.509] Error: The argument type 'RawKeyboard' can't be assigned to the parameter type 'HardwareKeyboard'.
[13:40:45.509]  - 'RawKeyboard' is from 'package:flutter/src/services/raw_keyboard.dart' ('flutter/packages/flutter/lib/src/services/raw_keyboard.dart').
[13:40:45.509]  - 'HardwareKeyboard' is from 'package:flutter/src/services/hardware_keyboard.dart' ('flutter/packages/flutter/lib/src/services/hardware_keyboard.dart').
[13:40:45.509]       if (action.key.accepts(keyEvent.event, state)) {
[13:40:45.509]                                              ^
[13:40:45.509] Error: Compilation failed.
[13:40:45.510]   Command: /vercel/path0/flutter/bin/cache/dart-sdk/bin/dart --disable-dart-dev /vercel/path0/flutter/bin/cache/dart-sdk/bin/snapshots/dart2js.dart.snapshot --platform-binaries=/vercel/path0/flutter/bin/cache/flutter_web_sdk/kernel --invoker=flutter_tool -Ddart.vm.product=true -DFLUTTER_WEB_AUTO_DETECT=true -DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/d7af5fb60b4c2783f44475309c7692af25d5cebd/ --native-null-assertions --no-source-maps -o /vercel/path0/.dart_tool/flutter_build/b2903368cdf0d0ec3915a0851d55b6fc/app.dill --packages=.dart_tool/package_config.json --cfe-only /vercel/path0/.dart_tool/flutter_build/b2903368cdf0d0ec3915a0851d55b6fc/main.dart
[13:40:45.511] #0      RunResult.throwException (package:flutter_tools/src/base/process.dart:127:5)
[13:40:45.512] #1      _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:280:19)
[13:40:45.512] <asynchronous suspension>
[13:40:45.512] #2      Dart2JSTarget.build (package:flutter_tools/src/build_system/targets/web.dart:188:5)
[13:40:45.513] <asynchronous suspension>
[13:40:45.513] #3      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:853:9)
[13:40:45.514] <asynchronous suspension>
[13:40:45.514] #4      Future.wait.<anonymous closure> (dart:async/future.dart:518:21)
[13:40:45.514] <asynchronous suspension>
[13:40:45.514] #5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:791:32)
[13:40:45.514] <asynchronous suspension>
[13:40:45.514] #6      Future.wait.<anonymous closure> (dart:async/future.dart:518:21)
[13:40:45.514] <asynchronous suspension>
[13:40:45.514] #7      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:791:32)
[13:40:45.514] <asynchronous suspension>
[13:40:45.514] #8      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:620:16)
[13:40:45.514] <asynchronous suspension>
[13:40:45.514] #9      WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:93:34)
[13:40:45.514] <asynchronous suspension>
[13:40:45.514] #10     BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:200:5)
[13:40:45.515] <asynchronous suspension>
[13:40:45.515] #11     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1388:27)
[13:40:45.515] <asynchronous suspension>
[13:40:45.515] #12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
[13:40:45.515] <asynchronous suspension>
[13:40:45.515] #13     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
[13:40:45.515] <asynchronous suspension>
[13:40:45.515] #14     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:349:9)
[13:40:45.515] <asynchronous suspension>
[13:40:45.515] #15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
[13:40:45.515] <asynchronous suspension>
[13:40:45.515] #16     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:294:5)
[13:40:45.515] <asynchronous suspension>
[13:40:45.515] #17     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:118:9)
[13:40:45.515] <asynchronous suspension>
[13:40:45.515] #18     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
[13:40:45.515] <asynchronous suspension>
[13:40:45.515] #19     main (package:flutter_tools/executable.dart:90:3)
[13:40:45.515] <asynchronous suspension>
[13:40:45.515] 
[13:40:45.516] Compiling lib/main.dart for the Web...                             19.4s
[13:40:45.516] Error: Failed to compile application for the Web.
[13:40:45.526] Error: Command "flutter/bin/flutter build web --release --no-tree-shake-icons" exited with 1
[13:40:45.800] 
freddydrodev commented 7 months ago

Hi @hiromumachi I have made a pull request to solve this issue. It was related to the newer version of Flutter. It works for me now

PS: I have deployed the app on vercel

As the PR is not yet approved you can still use the version from my GitHub account as follow:

dependencies:
  pluto_grid:
      git:
        url: https://github.com/freddydrodev/pluto_grid.git
        ref: web-fixed

Make sure to have the latest version of Flutter

hiromumachi commented 7 months ago

Thank you. However, I encountered the following error with pluto_grid_export, so please fit it...

Because pluto_grid_export 1.0.6 depends on pluto_grid >=3.0.2 <8.0.0, and no versions of pluto_grid_export match >1.0.6 <2.0.0, pluto_grid_export ^1.0.6 requires pluto_grid from hosted.

This issue itself has been resolved ! Thank you for the prompt response.

freddydrodev commented 7 months ago

Ok I will check it out.

freddydrodev commented 7 months ago

Hi @hiromumachi, I have tried the pluto_grid_export. It is actually embedded into the pluto_grid_export repository so you will need to install it as a path. Try this and let me know if it works:

dependencies:
  pluto_grid:
      git:
        url: https://github.com/freddydrodev/pluto_grid.git
        ref: web-fixed
  pluto_grid_export:
      git:
        url: https://github.com/freddydrodev/pluto_grid.git
        ref: web-fixed
        path: pluto_grid/packages/pluto_grid_export

You can also check this link for more information about how to install package using path on flutter and this one is actually the path for pluto_grid_export into the repository.

hiromumachi commented 7 months ago

I made the following modifications, but I'm encountering an error with pub get.

pluto_grid:
  git:
    url: https://github.com/freddydrodev/pluto_grid.git
    ref: web-fixed

pluto_grid_export:
  git:
    url: https://github.com/freddydrodev/pluto_grid.git
    ref: web-fixed
    path: packages/pluto_grid_export (pluto_grid/packages/pluto_grid_export is another error)

error

Because every version of pluto_grid_export from git depends on pluto_grid from path and delivery_control_web depends on pluto_grid from git, pluto_grid_export from git is forbidden.
So, because delivery_control_web depends on pluto_grid_export from git, version solving failed.
freddydrodev commented 7 months ago

Let me see your pubspec.yaml file

hiromumachi commented 7 months ago

Thank you for your kindness!

This is my pubspec.yaml file

And It works when use one of each

version: 1.0.0+1

environment:
  sdk: ">=3.1.3 <4.0.0"

dependencies:
  flutter:
    sdk: flutter
  easy_sidemenu: ^0.4.1
  email_validator: ^2.0.1
  async: ^2.10.0
  flutter_pw_validator: ^1.5.0
  flutter_speed_dial: ^7.0.0
  expandable: ^5.0.1
  excel: ^2.1.0
  table_calendar: ^3.0.9
  url_launcher: ^6.1.11
  just_audio: ^0.9.33
  lottie: ^2.3.2
  flutter_localizations:
    sdk: flutter
  flutter_barcode_scanner: ^2.0.0
  mailer: ^6.0.1
  file_saver: ^0.2.8
  pluto_grid:
    git:
      url: https://github.com/freddydrodev/pluto_grid.git
      ref: web-fixed
  pluto_grid_export:
    git:
      url: https://github.com/freddydrodev/pluto_grid.git
      ref: web-fixed
      path: packages/pluto_grid_export
freddydrodev commented 7 months ago

You are welcome I will try to install your packages and see what is the issue

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 6 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

chaotzu commented 5 months ago

I made the following modifications, but I'm encountering an error with pub get.

pluto_grid:
  git:
    url: https://github.com/freddydrodev/pluto_grid.git
    ref: web-fixed

pluto_grid_export:
  git:
    url: https://github.com/freddydrodev/pluto_grid.git
    ref: web-fixed
    path: packages/pluto_grid_export (pluto_grid/packages/pluto_grid_export is another error)

error

Because every version of pluto_grid_export from git depends on pluto_grid from path and delivery_control_web depends on pluto_grid from git, pluto_grid_export from git is forbidden.
So, because delivery_control_web depends on pluto_grid_export from git, version solving failed.

i have same error

chaotzu commented 5 months ago

Downgrade flutter version to 3.16.0 And this is my pubspec.yaml and found now:

dependencies: flutter: sdk: flutter

cupertino_icons: ^1.0.2 #^1.0.2 provider: ^6.0.4 #^6.0.4 font_awesome_flutter: ^10.3.0 shared_preferences: ^2.0.15 file_picker: ^6.1.1 #^5.5.0 universal_io: ^2.0.4 dio: ^5.3.2 #^4.0.0 syncfusion_flutter_pdfviewer: ^24.1.44 #^22.2.12 rflutter_alert: ^2.0.4 url_launcher: ^6.0.9 pluto_grid: ^7.0.2 #^5.4.9 file_saver: ^0.2.8 #^0.1.0

pluto_grid_export: ^1.0.6