dart-archive / rpc

RPC package for building server-side RESTful Dart APIs.
https://pub.dartlang.org/packages/rpc
BSD 3-Clause "New" or "Revised" License
117 stars 49 forks source link

rpc:generate client error: Could not import... No mapping for... #115

Closed supermuka closed 6 years ago

supermuka commented 6 years ago

The following error occurs when the Stubs are generated. I am using Windows OS, maybe that the problem is the inveted bar on path, but I dont sure!

This error occurs for all packages imported into file that I have @ApiClass().

D:\Users\Samuel\IdeaProjects\auge_server>pub global run rpc:generate client -i lib\auge_api.dart -o lib\client Unhandled exception: [IsolateSpawnException: Unable to spawn isolate: Unhandled exception: Could not import "package:auge_model/auge_model.dart" from "file:///D:/Users/Samuel/IdeaProjects/auge_server/lib/auge_api.dart": No mapping for 'auge_model' package when resolving 'package:auge_model/auge_model.dart'. null, #0 Isolate.spawnUri (dart:isolate-patch/dart:isolate/isolate_patch.dart:454)

#1 ClientApiGenerator._isolateTrampoline (http://localhost:52367/generate.dart:298) #2 _startIsolate. (dart:isolate-patch/dart:isolate/isolate_patch.dart:282) #3 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165) #4 ClientApiGenerator.generateDiscoveryWithImports. (http://localhost:52367/generate.dart:206) #5 ClientApiGenerator._withServer (http://localhost:52367/generate.dart:289) #6 ClientApiGenerator.generateDiscoveryWithImports (http://localhost:52367/generate.dart:204) #7 main (http://localhost:52367/generate.dart:122) #8 _startIsolate. (dart:isolate-patch/dart:isolate/isolate_patch.dart:277) #9 _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)
supermuka commented 6 years ago

I removed the global on command line like pub run rpc:generate client -i lib\auge_api.dart -o lib\client and works.