Rahuketu86
Rahuketu86

Reputation: 595

Why does importing browser_logging_handler from Dart Logging_handler package fails here?

Here is my pubspec.yaml file. I have run pub get a couple of times.

name: LogTest
description: A sample Polymer application
dependencies:
  logging: any
  logging_handlers: any
  polymer: '>=0.12.0 <0.13.0'
transformers:
- polymer:
    entry_points: web/logtest.html

Yet when I try running my app. It fails with following message:

Failed to load resource: the server responded with a status of 404 (Not Found)   
http://localhost:8081/packages/logging_handlers/browser_logging_handlers.dart An error occurred loading     
file: package:logging_handlers/browser_logging_handlers.dart

My dart file (logtest.dart) :

import 'package:polymer/polymer.dart'as polymer;
import 'package:logging/logging.dart'; 
import 'package:logging_handlers/browser_logging_handlers.dart';

void main(){
  polymer.initPolymer().run((){
    polymer.Polymer.onReady.then((_){
//      loggie.attachXLoggerUi();
    });
  });
}

and html file(logtest.html):

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sample app</title>

    <!-- include the web_components polyfills with support for Dart. -->
    <script src="packages/web_components/platform.js"></script>
    <script src="packages/web_components/dart_support.js"></script>

    <!-- import the click-counter -->
    <link rel="import" href="clickcounter.html">

    <link rel="stylesheet" href="logtest.css">
  </head>
  <body>
    <h1>LogTest</h1>

    <p>Hello world from Dart!</p>

    <div id="sample_container_id">
      <click-counter count="5"></click-counter>
    </div>

    <!-- bootstrap polymer -->
    <script type="application/dart" src="logtest.dart"></script>
    <script src="packages/browser/dart.js"></script>
  </body>
</html>

Upvotes: 1

Views: 66

Answers (1)

G&#252;nter Z&#246;chbauer
G&#252;nter Z&#246;chbauer

Reputation: 657338

Looks like pub serve didn't recognize the change in the pubspec.yaml file or the additional link in the packages directory. The pub serve output view has a button to stop pub serve. The next time you launch the app, pub serve is launched again automatically.

Upvotes: 1

Related Questions