JPM [error]消息:SyntaxError:重复标签 [英] JPM [error] Message: SyntaxError: duplicate label

查看:169
本文介绍了JPM [error]消息:SyntaxError:重复标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个Firefox扩展,并得到这个错误信息。这是什么意思?
$ b $ p 我只有标签

  require(sdk / ui / button / action)ActionButton({
id:show-popup,
label:一些不可能是重复的,
...

添加一个背景页面:

  require(sdk / page-worker)。Page({
contentScript:[ ...一些脚本...]
));

测试时,错误:

pre $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $' MyExtensionTitle
JPM创建一个新的配置文件
console.error:myextensiontitle:
JPM [error]消息:SyntaxError:重复标签

只有当我添加后台脚本时才会发生这种情况,如何进一步调试?我所要做的只是一个模糊的终端消息,没有行号。 p>

解决方案

页面工作者 contentScript 是源代码。它应该是 contentScriptFile 而不是:

  require(sdk / page- ({
contentScriptFile:[... some scripts ...]
});


I'm working on a firefox extension and am getting this error message. What does it mean?

The only label I have is from:

require("sdk/ui/button/action").ActionButton({
    id: "show-popup",
    label: "something that can't possibly be a duplicate",
    ...

Later on I add a background page:

require("sdk/page-worker").Page({
    contentScript: [ ... some scripts ... ]
});

While testing, I get the error:

> jpm run -b $(which firefox)
JPM [info] Starting jpm run on MyExtensionTitle
JPM [info] Creating a new profile
console.error: myextensiontitle: 
JPM [error]   Message: SyntaxError: duplicate label

This only happens when I add the background script. How can I debug further? All I have to go on is an ambiguous terminal message and no line number.

解决方案

A page-worker's contentScript is the source code. It should be contentScriptFile instead:

require("sdk/page-worker").Page({
    contentScriptFile: [ ... some scripts ... ]
});

这篇关于JPM [error]消息:SyntaxError:重复标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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