aad_oauth icon indicating copy to clipboard operation
aad_oauth copied to clipboard

Cannot read properties of undefined (reading 'init')

Open mitchstonegc opened this issue 1 year ago • 3 comments

I started a fresh project and imported the example code to get the auth process running.

The following error occurs and the app fails on build.

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ════════════════════════════════════════════════════ The following JSNoSuchMethodError was thrown building Builder: TypeError: Cannot read properties of undefined (reading 'init')

When the exception was thrown, this was the stack: packages/aad_oauth/helper/web_oauth.dart 54:5 new packages/aad_oauth/helper/web_oauth.dart 148:44 getOAuthConfig packages/aad_oauth/helper/core_oauth.dart 37:41 fromConfig packages/aad_oauth/aad_oauth.dart 17:52 new packages/flutter/src/widgets/framework.dart ............... packages/flutter/src/widgets/framework.dart ............... packages/flutter/src/widgets/framework.dart 3846:18 updateChild packages/flutter/src/widgets/binding.dart 1354:16 [_rebuild] packages/flutter/src/widgets/binding.dart 1323:5 mount packages/flutter/src/widgets/binding.dart 1276:16 packages/flutter/src/widgets/framework.dart 2844:11 buildScope packages/flutter/src/widgets/binding.dart 1275:12 attach packages/flutter/src/widgets/binding.dart 1088:26 attachToBuildOwner packages/flutter/src/widgets/binding.dart 1070:5 attachRootWidget packages/flutter/src/widgets/binding.dart 1056:7 dart-sdk/lib/_internal/js_dev_runtime/private/isolate_helper.dart 48:11 internalCallback

My setup: • Flutter version 3.19.3 on channel stable at C:\frameworks\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision ba39319843 (8 hours ago), 2024-03-07 15:22:21 -0600 • Engine revision 2e4ba9c6fb • Dart version 3.3.1 • DevTools version 2.31.1

mitchstonegc avatar Mar 08 '24 05:03 mitchstonegc

Seems that you haven't modified your Index.html:

image

For any further information, read the documentation on the flutter pub.dev page:

https://pub.dev/packages/aad_oauth

AliGuemues avatar Mar 08 '24 13:03 AliGuemues

Ah yes, I see. How else would it know where to look for the js files.

Thank you for your help!

mitchstonegc avatar Mar 10 '24 21:03 mitchstonegc

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you still think this issue is needed, reopen it again.

github-actions[bot] avatar May 10 '24 02:05 github-actions[bot]

false

github-actions[bot] avatar Jun 10 '24 02:06 github-actions[bot]