简体   繁体   中英

Dart editor “source not available”

I have the following basic code:

import 'package:jwt/json_web_token.dart';

main() {
  final jwt = new JsonWebTokenCodec(secret:'***'); 
  print(jwt.isValid('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2NmYy5hdXRoMC5jb20vIiwic3ViIjoiZ29vZ2xlLW9hdXRoMnwxMDc2MTcxNDk0MjIzMjU3MTU5MTciLCJhdWQiOiJ5a2h5NVJVbEpNSGw4Tzc0bGJ3Z29GZVVkUkI0VzZKRiIsImV4cCI6MTQxNjUzNTk3NCwiaWF0IjoxNDE2NDk5OTc0fQ.K_xAuG_rIAFe-zFFqn8SqXby3aqAkRJP2HrOjMnNUu0'));
  print(jwt.decode('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2NmYy5hdXRoMC5jb20vIiwic3ViIjoiZ29vZ2xlLW9hdXRoMnwxMDc2MTcxNDk0MjIzMjU3MTU5MTciLCJhdWQiOiJ5a2h5NVJVbEpNSGw4Tzc0bGJ3Z29GZVVkUkI0VzZKRiIsImV4cCI6MTQxNjUzNTk3NCwiaWF0IjoxNDE2NDk5OTc0fQ.K_xAuG_rIAFe-zFFqn8SqXby3aqAkRJP2HrOjMnNUu0'));
}

I then step inside the jwt package and set a breakpoint in the decode function. When I try to run my code I get the message: "Source not available Source not available for JsonWebTokeCodec.decode() ", which is strange since I stepped into the code to set the breakpoint. Is it not possible to set a breakpoint in an imported library?

Could it be my project structure that messes things up? The file is called server.dart and is in a folder called bin . There is also a app.yaml , Dockerfile and a package.json file in the root dir of the project. (I started out following the appengine example)

Edit: Im running it directly from the dart editor (the green play button, which I guess does pub serve ), not using the appengine package at all. I also deleted app.yaml and dockerfile and the problem still persists. I also tried creating a new project (shelf template project) but was still not able to see the source code when the editor breaks on a breakpoint in imported code.

我正在运行Dart 1.8的开发版,当我重新安装Dart 1.7.2时,问题消失了。

I think this is because debugging is not yet supposed to work for Dart AppEngine applications.

The related bug should be fixed but the used google/dart-runtime Docker images is still Dart 1.7.2 which doesn't contain the fix.

See also

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM