About a feature on last update

Troubleshooting

Hello ยง

After the last update the Canvaskit Update has been remplaced by WASM, i had it enabled but when i enable WASM i have a lot of problem when I'm trying to publish on web :


Full issue code :

Target dart2wasm failed: ProcessException: Process exited abnormally with exit code 254: /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:5:8: Error: Dart library 'dart:html' is not available on this platform. import 'dart:html' as html; ^ Context: The unavailable library 'dart:html' is imported through these packages: web_plugin_registrant.dart => package:flutter_secure_storage_web => dart:html Detailed import paths for (some of) the these imports: main.dart => web_plugin_registrant.dart => package:flutter_secure_storage_web/flutter_secure_storage_web.dart => dart:html main.dart => web_plugin_registrant.dart => package:flutter_secure_storage_web/flutter_secure_storage_web.dart => package:flutter_secure_storage_web/src/subtle.dart => dart:html /opt/.pub-cache/hosted/pub.dev/js-0.6.7/lib/js.dart:10:1: Error: Dart library 'dart:js' is not available on this platform. export 'dart:js' show allowInterop, allowInteropCaptureThis; ^ Context: The unavailable library 'dart:js' is imported through these packages: web_plugin_registrant.dart => package:flutter_secure_storage_web => package:js => dart:js Detailed import paths for (some of) the these imports: main.dart => web_plugin_registrant.dart => package:flutter_secure_storage_web/flutter_secure_storage_web.dart => package:flutter_secure_storage_web/src/subtle.dart => package:js/js.dart => dart:js /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:21:8: Error: Dart library 'dart:html' is not available on this platform. import 'dart:html'; ^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:94:10: Error: Type 'html.CryptoKey' not found. Future<html.CryptoKey> getEncryptionKey( ^^^^^^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/fluttersecure_storage_web-1.2.1/lib/src/subtle.dart:68:12: Error: Type 'CryptoKey' not found. external CryptoKey get privateKey; ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:69:12: Error: Type 'CryptoKey' not found. external CryptoKey get publicKey; ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:94:12: Error: Type 'CryptoKey' not found. external CryptoKey get public; ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:112:5: Error: Type 'CryptoKey' not found. CryptoKey public, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:144:3: Error: Type 'CryptoKey' not found. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:151:3: Error: Type 'CryptoKey' not found. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:158:3: Error: Type 'CryptoKey' not found. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:164:3: Error: Type 'CryptoKey' not found. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:168:18: Error: Type 'CryptoKey' not found. external Promise<CryptoKey> generateKey( ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:185:18: Error: Type 'CryptoKey' not found. external Promise<CryptoKey> importKey( ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:194:18: Error: Type 'CryptoKey' not found. external Promise<CryptoKey> importJsonWebKey( ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:205:3: Error: Type 'CryptoKey' not found. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:212:3: Error: Type 'CryptoKey' not found. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:220:3: Error: Type 'CryptoKey' not found. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:29:14: Error: Undefined name 'window'. html.window.localStorage.containsKey("${options[_publicKey]!}.$key"), ^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:40:10: Error: Undefined name 'window'. html.window.localStorage.remove("${options[_publicKey]!}.$key"); ^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:49:20: Error: Undefined name 'window'. () => html.window.localStorage.removeWhere((key, value) => true), ^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:61:24: Error: Undefined name 'window'. final value = html.window.localStorage["${options[_publicKey]!}.$key"]; ^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:73:30: Error: Undefined name 'window'. for (int j = 0; j < html.window.localStorage.length; j++) { ^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:74:26: Error: Undefined name 'window'. final entry = html.window.localStorage.entries.elementAt(j); ^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:98:15: Error: 'CryptoKey' isn't a type. late html.CryptoKey encryptionKey; ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:101:14: Error: Undefined name 'window'. if (html.window.localStorage.containsKey(key)) { ^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:102:37: Error: Undefined name 'window'. final jwk = base64Decode(html.window.localStorage[key]!); ^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:104:58: Error: 'CryptoKey' isn't a type. encryptionKey = await js_util.promiseToFuture<html.CryptoKey>( ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:110:58: Error: 'CryptoKey' isn't a type. encryptionKey = await js_util.promiseToFuture<html.CryptoKey>( ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:116:12: Error: Undefined name 'window'. html.window.localStorage[key] = base64Encode(jsonWebKey.asUint8List()); ^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:133:14: Error: Undefined name 'window'. html.window.crypto!.getRandomValues(Uint8List(12)).buffer.asUint8List(); ^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:152:10: Error: Undefined name 'window'. html.window.localStorage["${options[_publicKey]!}.$key"] = encoded; ^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:112:5: Error: 'CryptoKey' isn't a type. CryptoKey public, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:144:3: Error: 'CryptoKey' isn't a type. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:151:3: Error: 'CryptoKey' isn't a type. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:158:3: Error: 'CryptoKey' isn't a type. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:164:3: Error: 'CryptoKey' isn't a type. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:205:3: Error: 'CryptoKey' isn't a type. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:212:3: Error: 'CryptoKey' isn't a type. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:220:3: Error: 'CryptoKey' isn't a type. CryptoKey key, ^^^^^^^^^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:22:1: Error: JS interop library 'dart:js_util' can't be imported when compiling to Wasm. Try using 'dart:js_interop' or 'dart:js_interop_unsafe' instead. import 'dart:js_util' as js_util; ^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/src/subtle.dart:26:1: Error: JS interop library 'package:js/js.dart' can't be imported when compiling to Wasm. Try using 'dart:js_interop' or 'dart:js_interop_unsafe' instead. import 'package:js/js.dart'; ^ /opt/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.2.1/lib/flutter_secure_storage_web.dart:6:1: Error: JS interop library 'dart:js_util' can't be imported when compiling to Wasm. Try using 'dart:js_interop' or 'dart:js_interop_unsafe' instead. import 'dart:js_util' as js_util; ^ #0 RunResult.throwException (package:flutter_tools/src/base/process.dart:118:5) Error: Failed to compile application for the Web.


Please help,

Thank you !

What have you tried so far?

Nothing else honestly

Did you check FlutterFlow's Documentation for this topic?
No
4
7 replies