kevincharm / parcel-plugin-web-extension

📦🚀 Parcel plugin for WebExtension projects
Apache License 2.0
112 stars 16 forks source link

Parcel's development server not working with plugin #23

Open jameschensmith opened 5 years ago

jameschensmith commented 5 years ago

So, my extension is working fine in Firefox's about:debugging mode, but when running parcel src/manifest.json locally, a blank page is being displayed, and the following output is being shown in Debugger:

Error loading this URI: Could not load the source for http://localhost:1234/.
[Exception... "Component returned failure code: 0x80470002 (NS_BASE_STREAM_CLOSED) [nsIInputStream.available]"  nsresult: "0x80470002 (NS_BASE_STREAM_CLOSED)"  location: "JS frame :: resource://devtools/shared/base-loader.js -> resource://devtools/shared/DevToolsUtils.js :: onResponse :: line 568"  data: no]
Stack: onResponse@resource://devtools/shared/base-loader.js -> resource://devtools/shared/DevToolsUtils.js:568:25
onStopRequest@resource://gre/modules/NetUtil.jsm:126:17
Line: 568, column: 0

Here is my manifest.json file:

{
    "manifest_version": 2,
    "name": "...",
    "short_name": "...",
    "version": "0.1.0",
    "description": "...",
    "background": {
        "page": "index.html"
    },
    "applications": {
        "gecko": {
            "strict_min_version": "54.0"
        }
    },
    "chrome_url_overrides": {
        "newtab": "index.html"
    }
}

I'm just starting with JS and Firefox web extensions, so I'm not sure if this is due to your plugin, but running parcel src/index.html (i.e. not using the plugin) is working fine.

This issue just hinders development, so it's not too high of priority. If you can help, I would very much appreciate it. Thanks!

Dependencies:

{
  "dependencies": {
    "parcel-bundler": "^1.10.3",
    "react": "^16.6.3",
    "react-dom": "^16.6.3"
  },
  "devDependencies": {
    "@babel/core": "^7.2.0",
    "@babel/preset-react": "^7.0.0",
    "parcel-plugin-web-extension": "^1.4.0"
  }
}

FF version: 63.0.3 OS: MacOS Mojave 10.14.1

flybayer commented 5 years ago

For anyone else having this issue, keep an eye on https://github.com/parcel-bundler/parcel/issues/3362. Parcel v2 will have first-class support for web extensions.

quasicomputational commented 5 years ago

That issue is to do with Web Manifests, which is a W3C spec related to progressive web applications and not related to WebExtensions except that both involve a 'manifest' in JSON.

flybayer commented 5 years ago

@quasicomputational no, that issue includes WebExtension manifests too (granted it's not immediently obvious). These two manifest types are very similar so they have it grouped together.

They will be adding WebextManifestTransformer soon: https://github.com/parcel-bundler/parcel/pull/3404#issuecomment-522138982