auth0 / auth0-flutter

Auth0 SDK for Flutter
https://pub.dev/documentation/auth0_flutter/latest/
Apache License 2.0
61 stars 42 forks source link

Support new bootstrap method in Flutter 3.22 #464

Open EduardoYamauchi opened 5 months ago

EduardoYamauchi commented 5 months ago

Checklist

Description

Description:

With the release of Flutter 3.22, the method for bootstrapping has changed, as outlined in the official documentation: Flutter Web Bootstrapping. As a result, the Auth0 integration no longer works with this new method.

Issue:

• The previous bootstrap method is now deprecated and will soon stop functioning entirely.
• The Auth0 package needs to be updated to support the new bootstrapping method introduced in Flutter 3.22.

Request:

Please provide support for the new bootstrap method in Flutter 3.22. This is crucial to ensure continued compatibility and functionality of Auth0 with Flutter web applications.

Thank you for your attention to this matter.

Reproduction

1 - Follow the guide to update the bootstrapping in: https://docs.flutter.dev/platform-integration/web/bootstrapping 2 - Try to build an web application with auth0_flutter: 1.7.2

Additional context

No response

auth0_flutter version

1.7.2

Flutter version

3.22

Platform

Web

Platform version(s)

No response

amangsingh commented 5 months ago

I'm facing the same issue. Auth0 becomes completely unusable for web and is critical for my workflow

Solano-Furlan commented 4 months ago

Any updates on this?

desusai7 commented 3 months ago

Hi @EduardoYamauchi, @amangsingh, @Solano-Furlan,

Apologies for the delay in looking into this,

I've just tried using the flutter sdk version 1.7.2 with the flutter versions 3.22.0 & 3.24.0 in both debug, release modes and everything is working as expected, can anyone of you help us with a reproducible example or steps to reproduce ?

EduardoYamauchi commented 2 months ago

I tested again using:

And everything's is working as expected. I'm closing this issue, if you still having some issue related with the new bootstrap please send me a message to re-open.

Thank you.

EduardoYamauchi commented 2 months ago

I’m reopening this issue due to the following error:

TypeError: Cannot read properties of undefined (reading 'Auth0Client')
packages/auth0_flutter/src/web/auth0_flutter_plugin_real.dart 30:25  initialize
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54   runBody
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 127:5   _async
packages/auth0_flutter/src/web/auth0_flutter_plugin_real.dart 27:26  initialize
packages/auth0_flutter/auth0_flutter_web.dart 56:44                  onLoad
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 84:54   runBody

This error occurs randomly only when switching to the new bootstrap mode.

Steps to reproduce (on web):

  1. Add the required line for the web version in the index.html (following the documentation):

<script src="https://cdn.auth0.com/js/auth0-spa-js/2.0/auth0-spa-js.production.js" defer></script>

Screenshot 2024-09-16 at 15 49 46
  1. Run the following lines:
void main() async {
  var auth0Client = Auth0Client();
  await auth0Client.auth0Web!.onLoad();
}

I have been patiently waiting for the resolution of the WASM issue, which has now been open for 4 months since June. This is particularly important as it relates to performance and security of our applications.