Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad state: Asset URI is missing for abstract class JSObject #762

Open
Rexios80 opened this issue Jul 8, 2024 · 2 comments
Open

Bad state: Asset URI is missing for abstract class JSObject #762

Rexios80 opened this issue Jul 8, 2024 · 2 comments

Comments

@Rexios80
Copy link

Rexios80 commented Jul 8, 2024

Bad state: Asset URI is missing for abstract class JSObject
package:mockito/src/builder.dart 2200:10                     _MockClassInfo._typeImport
package:mockito/src/builder.dart 1676:21                     _MockClassInfo._addFakeClass.<fn>.<fn>.<fn>
package:code_builder/src/specs/type_reference.g.dart 164:33  _$TypeReferenceBuilder.update
package:code_builder/src/specs/type_reference.g.dart 22:36   new _$TypeReference
package:mockito/src/builder.dart 1673:33                     _MockClassInfo._addFakeClass.<fn>.<fn>
package:mockito/src/builder.dart 2075:24                     _MockClassInfo._withTypeParameters
package:mockito/src/builder.dart 1670:7                      _MockClassInfo._addFakeClass.<fn>
package:code_builder/src/specs/class.g.dart 345:33           _$ClassBuilder.update
package:code_builder/src/specs/class.g.dart 40:28            new _$Class
package:mockito/src/builder.dart 1663:37                     _MockClassInfo._addFakeClass
package:mockito/src/builder.dart 1622:7                      _MockClassInfo._dummyFakedValue
package:mockito/src/builder.dart 1644:27                     _MockClassInfo._dummyValueImplementing
package:mockito/src/builder.dart 1549:12                     _MockClassInfo._dummyValue
package:mockito/src/builder.dart 1652:11                     _MockClassInfo._dummyValueImplementing
package:mockito/src/builder.dart 1549:12                     _MockClassInfo._dummyValue
package:mockito/src/builder.dart 1951:24                     _MockClassInfo._buildOverridingGetter
package:mockito/src/builder.dart 1224:36                     _MockClassInfo.fieldOverrides.<fn>
package:code_builder/src/specs/method.g.dart 323:33          _$MethodBuilder.update
package:code_builder/src/specs/method.g.dart 38:29           new _$Method
package:mockito/src/builder.dart 1224:15                     _MockClassInfo.fieldOverrides
dart:core                                                    List.addAll
package:built_collection/src/list/list_builder.dart 98:14    ListBuilder.addAll
package:mockito/src/builder.dart 1182:28                     _MockClassInfo._buildMockClass.<fn>.<fn>
package:mockito/src/builder.dart 2075:24                     _MockClassInfo._withTypeParameters
package:mockito/src/builder.dart 1136:7                      _MockClassInfo._buildMockClass.<fn>
package:code_builder/src/specs/class.g.dart 345:33           _$ClassBuilder.update
package:code_builder/src/specs/class.g.dart 40:28            new _$Class
package:mockito/src/builder.dart 1114:12                     _MockClassInfo._buildMockClass
package:mockito/src/builder.dart 1060:9                      new _MockLibraryInfo
package:mockito/src/builder.dart 94:29                       MockBuilder.build

I get this when attempting to generate these mocks: https://github.com/Rexios80/packages_flutter/blob/afb21bc501403de977c404c995cbc41502381d9b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_controller_test.dart#L24

I had this issue before switching to the latest commit of mockito (which should really be released by now): #732

This is the type that's causing the issue:

abstract class GeometryController {
  /// The GMap instance that this controller operates on.
  late gmaps.Map googleMap;
}

@JS('google.maps.Map')
extension type Map._(MVCObject _) implements MVCObject {}

I tried adding googleMap to the unsupportedMembers but it doesn't make a difference

@Rexios80
Copy link
Author

Rexios80 commented Jul 8, 2024

Okay I swear I tried adding something to fallbackGenerators to fix this before but I did it just now and it works

@srawlins
Copy link
Member

srawlins commented Jul 8, 2024

Mockito still shouldn't crash so we'll leave this open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants