Dart-Code: Unable to open 'libintegers_patch.dart': Cannot read property 'create' of undefined.

I am not sure what caused this as I updated a few things in the mean time, but debugging now gives me a popup saying Unable to open 'libintegers_patch.dart': Cannot read property 'create' of undefined. when it hits an exception. I have everything pretty much on the newest version, but I can send version numbers if you want.

Something changed about the debugging interface as well because now I can see some kind of file tree when I start the debugger. However, somehow the debugger no longer pauses on uncaught exceptions. Instead it quits and prints some error the the debug output. I get:

loading test/all.dart:

ERROR: Failed to load "test/all.dart":
The getter 'isNotEmpty' was called on null.
Receiver: null
Tried calling: isNotEmpty

{stack trace in my project}

This could very well be an error with the test or analyzer package, but I am not sure to track down where it it coming from.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (9 by maintainers)

Commits related to this issue

Most upvoted comments

I’ve made two changes:

  1. If the path given to us by the VM does not exist on disk, return no source reference to VS Code (this will result in “Unknown Source” being shown in the call stack)
  2. If the user clicks on a stack frame that we thought we had source for (dart: libs in this case) but the VM returns undefined, then we will reject the request with <source not available>. This causes VS Code to show that string as if it was the source code for the file (!) but at least it’s clear to the user what’s happened.

It’s not ideal that we’re not going to show source code here, but that’s not something I can fix in Dart Code. I’ve added comments to https://github.com/dart-lang/sdk/issues/33959 so if things can be improved there, hopefully they will 😃