简体   繁体   中英

How can I view package or silent errors using Angular 2 Dart in WebStorm?

In my main app I wanted to add a tab to my component, so I used the Angular components package. I copied their example and was able to see the tabs. However, the tabs had no content and would not switch tabs.

I looked at the Angular components example page for help and cloned their example on my machine. I was finally able to isolate the problem and figure out that I needed to add the popupBindings provider to make the tabs work properly.

Is there a way to spot these types of errors more quickly? I don't expect my Dart analysis to catch this, but pub serve did not tell me any information either. Is there a command line option that I can use? I feel like I am missing something.

I was able to see a stack trace using the developer console in Chromium.

Here is a snippet of my pubspec file:

transformers:
- angular:
    entry_points: web/main.dart
- dart_to_js_script_rewriter
- $dart2js:
    commandLineOptions: [--show-package-warnings, --dump-info]
web:
  compiler:
    debug: dartdevc

These errors can't be caught by static analysis, but AngularDart will fail fast on them in runtime, and provide an actionable error message.

The problem might lie in the fact that when using WebStorm, there are two consoles. The one in your browser, and the one in WebStorm. When set up correctly, you'll see the error in WebStorm, and you can even step through the problem using the debugger. But it's not unusual that the WebStorm vs browser connection isn't set up correctly, isn't established, or gets broken. At that time, the error is only shown in the browser console, so if you're not expecting it there, you won't see it.

Here's how to set up WebStorm with Chrome . You'll need this browser extension , and you'll need to make sure the developer extension in Chrome isn't open (because that will close the connection to WebStorm).

If everything is set up correctly and you still don't see any error, then that's a bug on our side. Please file it here .

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