jonasroussel / dart_jsonwebtoken

A dart implementation of the famous javascript library 'jsonwebtoken'
MIT License
87 stars 29 forks source link

Error - run web application #11

Closed vvp-2020 closed 3 years ago

vvp-2020 commented 3 years ago

Hi!

pubspec.yaml:

dependencies: ... dart_jsonwebtoken: ^2.1.1 ...

NOT use import 'package:dart_jsonwebtoken/dart_jsonwebtoken.dart';

run: flutter run -d chrome

terminal: Launching lib\main.dart on Chrome in debug mode... Try changing the literal to something that can be represented in Javascript. In Javascript 0x5812631a5cf5d400 is the nearest value that can be represented exactly. [0x5812631a5cf5d3ed, 0x14def9dea2f79cd6, 0, 0x1000000000000000]);
^^^^^^^^^^^^^^^^^^ /c:/src/flutter/.pub-cache/hosted/pub.dartlang.org/ed25519_edwards-0.1.0/lib/src/edwards25519.dart:2099:26: Error: The integer literal 0x14def9dea2f79cd6 can't be represented exactly in JavaScript. Try changing the literal to something that can be represented in Javascript. In Javascript 0x14def9dea2f79d00 is the nearest value that can be represented exactly. [0x5812631a5cf5d3ed, 0x14def9dea2f79cd6, 0, 0x1000000000000000]); ^^^^^^^^^^^^^^^^^^ Waiting for connection from debug service on Chrome... 18,9s Failed to compile application.

flutter doctor:

[√] Flutter (Channel dev, 2.1.0-12.1.pre, on Microsoft Windows [Version 10.0.19041.985]) [X] Android toolchain - develop for Android devices X Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use flutter config --android-sdk to update to that location.

[√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Professional 2019 16.8.5) [!] Android Studio (not installed) [√] VS Code (version 1.56.2) [√] Connected device (3 available)

! Doctor found issues in 2 categories.

jonasroussel commented 3 years ago

Hi!

It was just an incompability with EdDSA algorithm and BigInt in JS.

Fixed in v2.2.0 (https://pub.dev/packages/dart_jsonwebtoken/versions/2.2.0)