injectable icon indicating copy to clipboard operation
injectable copied to clipboard

Warnings for importing files with export

Open Holofox opened this issue 4 years ago • 1 comments

Good afternoon! I get the following warning when importing a file containing exports of other dependencies:

Missing dependencies in superapp/injection.dart

[SessionService] depends on unregistered type [SessionServiceClient] from package:superapp/core/network/infrastructure/superapp/chat/v2/session.index.dart

session.index.dart

export 'session.pb.dart';
export 'session.pbenum.dart';
export 'session.pbjson.dart';
export 'session_service.pb.dart';
export 'session_service.pbenum.dart';
export 'session_service.pbgrpc.dart';
export 'session_service.pbjson.dart';

injection.config.dart

import 'core/network/infrastructure/superapp/chat/v2/session.index.dart'
    as superapp;

Future<GetIt> $initGetIt(
  GetIt get, {
  String environment,
  EnvironmentFilter environmentFilter,
}) async {
  final gh = GetItHelper(get, environment, environmentFilter);

  ...

  gh.lazySingleton<ISessionService>(
      () => SessionService(get<superapp.SessionServiceClient>()));

  ...
  
  return get;
}

It works, but I see warnings about it all the time.

Holofox avatar Nov 25 '20 06:11 Holofox

Having the same problem. In my case, the type resolver isn't figuring out the following are the same thing.

package:nxt/infrastructure/src/i_local_data_store.dart - ILocalDataStore
package:nxt/infrastructure/local_data_store.dart - ILocalDataStore

local_data_store.dart

library local_data_store;

export 'src/i_local_cache.dart';
export 'src/i_local_data_store.dart';
export 'src/nxt_local_data_store/nxt_local_cache.dart';
export 'src/nxt_local_data_store/nxt_local_data_store.dart';

kjones avatar Dec 03 '20 21:12 kjones

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

github-actions[bot] avatar Feb 23 '23 08:02 github-actions[bot]