清单无效的JSON.行:1,列:1,意外的令牌 [英] Manifest is not valid JSON. Line: 1, column: 1, Unexpected token

查看:901
本文介绍了清单无效的JSON.行:1,列:1,意外的令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请继续获取此错误: 清单无效的JSON.第1行,第1列,意外令牌." 我不明白我的代码有什么问题?这是我到目前为止所拥有的:

keep getting this error: "Manifest is not valid JSON. Line: 1, column: 1, Unexpected token." i don't understand what the issue is with my code? here is what i have so far:

{
    "manifest_version": 2,
    "name": "extension",
    "version": "1.0",
    "description": "My first Chrome extension.",
    "browser_action": {
        "default_icon": "icon.jpg",
        "popup": "popup.html"
    }
}

推荐答案

在Visual Studio 2010中,我将manifest.json文件属性设置为Build Action:无.

I had my manifest.json File Properties set with Build Action: None, in Visual Studio 2010.

在Visual Studio中更改为内容可确保在部署时文件已传输.

Changing, in Visual Studio, to Content ensured the file was transferred when I deployed.

也许你的是类似的问题.

Maybe yours is a similar issue.

修改

考虑到我的反对意见,我想我应该扩大并说我的意思是,鉴于在第1行,第1列有有效的json,与返回的实际json文件相比,您更有可能收到404 http响应

Given my downvote I thought I should expand and say that my point was that, given that at line 1, column 1 there is valid json, it is more likely that you are getting a 404 http response than the actual json file returned.

因此,也许该文件不在正确的位置,或者服务器没有权限等等,但是以上是我的问题所在.诚然,这可能是我的出了什么问题的具体原因,而不是肯定是您的出了什么问题.

So maybe the file isn't in the correct place or the server doesn't have permissions or whatever but the above is what had gone wrong with mine. Admittedly it is maybe too specific to what had gone wrong with mine and not definitely what was wrong with yours.

但是一般观点仍然存在,这很可能是由于Web服务器返回json文件的http响应,请在浏览器中的网络日志中检查响应.

But the general point still stands, it's more likely caused by web server returning an http response for the json file, check the response in the network log in your browser.

这篇关于清单无效的JSON.行:1,列:1,意外的令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆