You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After adding stash as a dependency to my pubspec.yaml, my application will no longer build for web
To Reproduce
Add stash: ^2.0.0-nullsafety.3 to pubspec.yaml
Run flutter run -d chrome
See error
../../Library/flutter/.pub-cache/hosted/pub.dartlang.org/stash-2.0.0-nullsafety.3/lib/src/api/expiry/expiry_policy.dart:8:50: Error: The integer literal 8999999999999999991 can't be represented exactly in JavaScript.
Try changing the literal to something that can be represented in Javascript. In Javascript 9000000000000000000 is the nearest value that can be represented exactly.
static const Duration eternal = Duration(days: 8999999999999999991);
Version
Dart SDK version: 2.13.0-116.0.dev (dev) (Sun Mar 7 18:57:20 2021 -0800) on "macos_x64"
Thanks for the report. I'll have to think this better to be honest.
This issue in particular is easy to solve but there is more problems with dartjs as the unit tests do not run for a number of reasons some easy to solve others not that trivial like this one: dart-lang/sdk#10275
I have for example an extension to write datetime with MsgPack that uses:
writer.writeUint64(object.microsecondsSinceEpoch); in order to serialize and deserialize the same thing
From documentation microsecondsSinceEpoch: Note that this value does not fit into 53 bits (the size of a IEEE double). A JavaScript number is not able to hold this value.
In the end I can make this compile but some advanced scenarios would break in dartjs (not stash related but any dependency that needs serialization / deserialization like stash_hive or stash_disk)
Describe the bug
After adding stash as a dependency to my pubspec.yaml, my application will no longer build for web
To Reproduce
stash: ^2.0.0-nullsafety.3
to pubspec.yamlflutter run -d chrome
../../Library/flutter/.pub-cache/hosted/pub.dartlang.org/stash-2.0.0-nullsafety.3/lib/src/api/expiry/expiry_policy.dart:8:50: Error: The integer literal 8999999999999999991 can't be represented exactly in JavaScript.
Try changing the literal to something that can be represented in Javascript. In Javascript 9000000000000000000 is the nearest value that can be represented exactly.
static const Duration eternal = Duration(days: 8999999999999999991);
Version
Dart SDK version: 2.13.0-116.0.dev (dev) (Sun Mar 7 18:57:20 2021 -0800) on "macos_x64"
Additional context
Flutter 2.1.0-12.2.pre • channel beta • git@github.com:flutter/flutter.git
Framework • revision 5bedb7b1d5 (4 weeks ago) • 2021-03-17 17:06:30 -0700
Engine • revision 711ab3fda0
Tools • Dart 2.13.0 (build 2.13.0-116.0.dev)
The text was updated successfully, but these errors were encountered: