警告[网络服务器]:404:/views/nav/offline.html

光纤

有人知道如何解决/删除此非常烦人的警告吗?

Running "karma:unit" (karma) task
INFO [karma]: Karma v0.12.23 server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.7 (Windows 7)]: Connected on socket rrNTMtmcd322dIl7A9fa with id 95590782
WARN [web-server]: 404: /views/nav/offline.html
WARN [web-server]: 404: /views/scan/scan.qr.html  

karma.conf.js

// Karma configuration
// http://karma-runner.github.io/0.12/config/configuration-file.html
// Generated on 2014-08-26 using
// generator-karma 0.8.3

module.exports = function (config) {
    'use strict';

    config.set({
        // enable / disable watching file and executing tests whenever any file changes
        autoWatch: true,

        // base path, that will be used to resolve files and exclude
        basePath: '../',

        // testing framework to use (jasmine/mocha/qunit/...)
        frameworks: ['jasmine'],

        // list of files / patterns to load in the browser
        files: [
            'bower_components/angular/angular.js',
            'bower_components/angular-mocks/angular-mocks.js',
            'bower_components/angular-animate/angular-animate.js',
            'bower_components/angular-cookies/angular-cookies.js',
            'bower_components/angular-resource/angular-resource.js',
            'bower_components/angular-route/angular-route.js',
            'bower_components/angular-sanitize/angular-sanitize.js',
            'bower_components/angular-touch/angular-touch.js',
            'bower_components/angular-ui-router/release/angular-ui-router.js',
            'bower_components/angular-local-storage/angular-local-storage.js',
            'bower_components/ionic/release/js/ionic.js',
            'bower_components/ionic/release/js/ionic-angular.js',
            'app/scripts/**/*.js',
            'test/spec/**/*.js'

        ],

        // list of files / patterns to exclude
        exclude: [],

        // web server port
        port: 8080,

        // Start these browsers, currently available:
        // - Chrome
        // - ChromeCanary
        // - Firefox
        // - Opera
        // - Safari (only Mac)
        // - PhantomJS
        // - IE (only Windows)
        browsers: [
            'PhantomJS'
        ],

        // Which plugins to enable
        plugins: [
            'karma-phantomjs-launcher',
            'karma-jasmine'
        ],

        // Continuous Integration mode
        // if true, it capture browsers, run tests and exit
        singleRun: false,

        colors: true,

        // level of logging
        // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
        logLevel: config.LOG_INFO

        // Uncomment the following lines if you are using grunt's server to run the tests
        // proxies: {
        //   '/': 'http://localhost:9000/'
        // },
        // URL root prevent conflicts with the site root
        // urlRoot: '_karma_'
    });
};  

在此处输入图片说明

app.js

.config(function ($stateProvider, $urlRouterProvider) {

    $stateProvider

        // ACCOUNT
        .state('account', {
            abstract: true,
            url: '/account',
            templateUrl: 'index.html'
        })
        .state('account.main', {
            url: '',
            templateUrl: 'views/account/account.main.html'
        })
        .
        .
        .

        // MENU
        .state('menu', {
            abstract: true,
            url: '/menu',
            templateUrl: 'views/nav/menu.html'
        })
        .state('menu.main', {
            url: '/main',
            views: {
                'menuContent': {
                    templateUrl: 'views/dash/dash.main.html'
                }
            }
        })
        .
        .
        .

        // OFFLINE MENU
        .state('offline', {
            abstract: true,
            url: '/offline',
            templateUrl: 'views/nav/offline.html'
        })
        .state('offline.product', {
            url: '/product',
            views: {
                'menuContent': {
                    templateUrl: 'views/product/product.list.html'
                }
            }
        })
        .state('offline.qr', {
            url: '/qr',
            views: {
                'menuContent': {
                    templateUrl: 'views/scan/scan.qr.html'
                }
            }
        })
        .state('offline.cart', {
            url: '/cart',
            views: {
                'menuContent': {
                    templateUrl: 'views/cart/cart.list.html'
                }
            }
        })
    ;

    $urlRouterProvider.otherwise('/account');

})

我也尝试过以下相关问题:
如何在业力单元测试期间修复图像的404警告,但
没有运气。

更多信息

我也尝试了以下方法:
1)将路径添加到html:

'app/scripts/**/*.js',
'app/views/**/*.html',
'test/spec/**/*.js'  

2)创建模式:

'app/scripts/**/*.js',            
'test/spec/**/*.js',
{pattern: 'app/views/**', watched: false, included: false, served: true}  

3)排除html文件的路径:

// list of files / patterns to exclude
exclude: ['app/views/**'],

但是没有任何效果,警告仍然存在。我假设这可能是一个错误?

编辑1

我只是按照查德·罗宾逊的话做的,接下来的警告是关于失踪的警告index.html
所以我要做的是:

proxies: {
    '/views/': '/app/views/',
    '/index.html': '/app/index.html'
}  

但是仍然有警告:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Grabhut.MobileApp\Grabhut>grunt
Running "newer:jshint" (newer) task

Running "newer:jshint:all" (newer) task
No newer files to process.

Running "newer:jshint:test" (newer) task
No newer files to process.

Running "clean:server" (clean) task
Cleaning .tmp...OK

Running "concurrent:test" (concurrent) task

Running "compass:dist" (compass) task
directory .tmp/styles
        write .tmp/styles/icomoon.css (0.007s)
        write .tmp/styles/override.css (0.055s)

Running "compass:server" (compass) task

Done, without errors.

Running "autoprefixer:dist" (autoprefixer) task
File .tmp/styles/icomoon.css created.

C:\Grabhut.MobileApp\Grabhut>grunt
Running "newer:jshint" (newer) task

Running "newer:jshint:all" (newer) task
No newer files to process.

Running "newer:jshint:test" (newer) task
No newer files to process.

Running "clean:server" (clean) task
Cleaning .tmp...OK

Running "concurrent:test" (concurrent) task

Running "compass:dist" (compass) task
directory .tmp/styles
        write .tmp/styles/icomoon.css (0.007s)
        write .tmp/styles/override.css (0.054s)

Running "compass:server" (compass) task

Done, without errors.

Running "autoprefixer:dist" (autoprefixer) task
File .tmp/styles/icomoon.css created.
File .tmp/styles/override.css created.

Running "connect:test" (connect) task
Started connect web server on http://localhost:9001

Running "karma:unit" (karma) task

C:\Grabhut.MobileApp\Grabhut\test\karma.conf.js:73

C:\Grabhut.MobileApp\Grabhut>grunt
Running "newer:jshint" (newer) task

Running "newer:jshint:all" (newer) task
No newer files to process.

Running "newer:jshint:test" (newer) task
No newer files to process.

Running "clean:server" (clean) task
Cleaning .tmp...OK

Running "concurrent:test" (concurrent) task

Running "compass:dist" (compass) task
directory .tmp/styles
        write .tmp/styles/icomoon.css (0.007s)
        write .tmp/styles/override.css (0.054s)

Running "compass:server" (compass) task

Done, without errors.

Running "autoprefixer:dist" (autoprefixer) task
File .tmp/styles/icomoon.css created.

C:\Grabhut.MobileApp\Grabhut>grunt
Running "newer:jshint" (newer) task

Running "newer:jshint:all" (newer) task
No newer files to process.

Running "newer:jshint:test" (newer) task
No newer files to process.

Running "clean:server" (clean) task
Cleaning .tmp...OK

Running "concurrent:test" (concurrent) task

Running "compass:dist" (compass) task
directory .tmp/styles
        write .tmp/styles/icomoon.css (0.007s)
        write .tmp/styles/override.css (0.055s)

Running "compass:server" (compass) task

Done, without errors.

Running "autoprefixer:dist" (autoprefixer) task
File .tmp/styles/icomoon.css created.
File .tmp/styles/override.css created.

Running "connect:test" (connect) task
Started connect web server on http://localhost:9001

Running "karma:unit" (karma) task
INFO [karma]: Karma v0.12.23 server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.7 (Windows 7)]: Connected on socket PFqYQtg4gwm4psBKKJ5T with id 70053285
PhantomJS 1.9.7 (Windows 7): Executed 0 of 0 ERROR (0.001 secs / 0 secs)
Warning: Task "karma:unit" failed. Use --force to continue.

Aborted due to warnings.


Execution Time (2014-09-29 02:06:16 UTC)
concurrent:test     6.3s  ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 78%
autoprefixer:dist   97ms  ■■ 1%
connect:test       433ms  ■■■■■■■■■ 5%
karma:unit          1.2s  ■■■■■■■■■■■■■■■■■■■■■■■ 15%
Total 8.1s


C:\Grabhut.MobileApp\Grabhut>       

业力怎么了?

编辑2 Karma.conf.js

请参阅底部的karama配置更新:

// Karma configuration
// http://karma-runner.github.io/0.12/config/configuration-file.html
// Generated on 2014-08-26 using
// generator-karma 0.8.3

module.exports = function (config) {
    'use strict';

    config.set({
        // enable / disable watching file and executing tests whenever any file changes
        autoWatch: true,

        // base path, that will be used to resolve files and exclude
        basePath: '../',

        // testing framework to use (jasmine/mocha/qunit/...)
        frameworks: ['jasmine'],

        // list of files / patterns to load in the browser
        files: [
            'bower_components/angular/angular.js',
            'bower_components/angular-mocks/angular-mocks.js',
            'bower_components/angular-animate/angular-animate.js',
            'bower_components/angular-cookies/angular-cookies.js',
            'bower_components/angular-resource/angular-resource.js',
            'bower_components/angular-route/angular-route.js',
            'bower_components/angular-sanitize/angular-sanitize.js',
            'bower_components/angular-touch/angular-touch.js',
            'bower_components/angular-ui-router/release/angular-ui-router.js',
            'bower_components/angular-local-storage/angular-local-storage.js',
            'bower_components/ionic/release/js/ionic.js',
            'bower_components/ionic/release/js/ionic-angular.js',
            'app/scripts/**/*.js',
            'test/spec/**/*.js'

        ],

        // list of files / patterns to exclude
        exclude: [],

        // web server port
        port: 8080,

        // Start these browsers, currently available:
        // - Chrome
        // - ChromeCanary
        // - Firefox
        // - Opera
        // - Safari (only Mac)
        // - PhantomJS
        // - IE (only Windows)
        browsers: [
            'PhantomJS'
        ],

        // Which plugins to enable
        plugins: [
            'karma-phantomjs-launcher',
            'karma-jasmine'
        ],

        // Continuous Integration mode
        // if true, it capture browsers, run tests and exit
        singleRun: false,

        colors: true,

        // level of logging
        // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
        logLevel: config.LOG_INFO,

        // Uncomment the following lines if you are using grunt's server to run the tests
        proxies: {
            '/views/': '/app/views/',
            '/index.html': '/app/index.html'
        }
        // URL root prevent conflicts with the site root
        // urlRoot: '_karma_'
    });
};
乍得·罗宾逊

根据您的Karma配置,您似乎从项目的根级别开始运行它。但是您的应用程序在其中app/,并且您的模板是对于该路径的...也就是说,您正在访问/views/nav/offline.html而不是/app/views/nav/offline.html业力不知道该怎么办。

尝试代理:

proxies =  {
  '/views/': '/app/views/'
};

这将告诉Karma将/ views / *请求视为/ app / views / *请求。或者,您可以将Karma的配置向下移动到app/其自身。然后将包含路径和其他相关项目更改为正确的URL,问题将消失。(这就是我的工作。)

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

在没有网络服务器的html页面上显示csv-datei的信息

来自分类Dev

带有 php 的 HTML5 是否需要网络服务器?

来自分类Dev

如何将 HTML 页面从 C 网络服务器发送到网络浏览器

来自分类Dev

在 HTML5 画布上显示本地可用的 JPEG 编码博客 - 浏览器尝试连接到网络服务器

来自分类Dev

如何修复导致“业力警告[网络服务器]:404”的图像?

来自分类Dev

在网络服务器上时,IE / FF无法找到可播放HTML5的视频。-Chrome可以正常播放

来自分类Dev

双向网络服务器

来自分类Dev

实时网络服务器上的404 Code Igniter

来自分类Dev

实时网络服务器上的404 Code Igniter

来自分类Dev

从“自身”从网络服务器下载文件时出现404错误

来自分类Dev

具有sophos utm的网络服务器-未找到网站404错误

来自分类Dev

在 Angular-Wakanda 网络服务器上重新加载页面给出 404

来自分类Dev

网络服务器的out.flush()问题

来自分类Dev

与网络服务器相关的autoIndex是什么?

来自分类Dev

设置安全的网络服务器

来自分类Dev

设置动态网络服务器

来自分类Dev

保持我的生产网络服务器更新

来自分类Dev

网络服务器上的Memcached

来自分类Dev

将android应用与网络服务器连接

来自分类Dev

在Yaws网络服务器上上传进度

来自分类Dev

简单的网络服务器无法正常工作

来自分类Dev

元素在网络服务器上消失

来自分类Dev

网络服务器显示错误的布局

来自分类Dev

网站/网络服务器容错-最佳做法

来自分类Dev

oAuth2 的 Java 网络服务器

来自分类Dev

网络服务器 php 和 mysql 滞后

来自分类Dev

自动启动网络服务器和程序

来自分类Dev

Apache 网络服务器如何检测 CNAME

来自分类Dev

使用ajax从网络服务器获取响应

Related 相关文章

热门标签

归档