adambullmer / vue-cli-plugin-browser-extension

Browser extension development plugin for vue-cli 3.0
GNU Lesser General Public License v3.0
427 stars 76 forks source link

Webpack running twice? Consistently getting error about port in use. #15

Closed korziee closed 5 years ago

korziee commented 6 years ago

EDIT: Clicked enter too early, didn't add a description.

Hi, i'm having an issue with getting the npm run serve with the live reload server to work.

Whenever I run npm run serve i'm consistently getting:

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE :::9090

The only way to remediate i've been able to remediate this issue was:

  1. Comment out the line which contains webpackConfig.plugins.push(new ChromeExtensionReloader({ entries })) in the vue-cli-plugin-browser-extension/index.js file.
  2. Run npm run serve
  3. Cancel the process.
  4. Uncomment out the changes I made in step 1.
  5. Run npm run serve

Some more info:

I've added a console.trace() into the vue-cli-plugin-browser-extension/index.js file, inside the api.configureWebpack function and the outputs i'm getting (in order), are the following:

Output 1:

⠋  Building for development...
[object Object]
    at api.configureWebpack (/Users/kory/Publift/publift-chrome-extension/node_modules/vue-cli-plugin-browser-extension/index.js:35:13)
    at webpackRawConfigFns.forEach.fn (/Users/kory/Publift/publift-chrome-extension/node_modules/@vue/cli-service/lib/Service.js:227:21)
    at Array.forEach (<anonymous>)
    at Service.resolveWebpackConfig (/Users/kory/Publift/publift-chrome-extension/node_modules/@vue/cli-service/lib/Service.js:224:30)
    at PluginAPI.resolveWebpackConfig (/Users/kory/Publift/publift-chrome-extension/node_modules/@vue/cli-service/lib/PluginAPI.js:115:25)
    at module.exports (/Users/kory/Publift/publift-chrome-extension/node_modules/@vue/cli-service/lib/commands/build/resolveAppConfig.js:34:25)
    at build (/Users/kory/Publift/publift-chrome-extension/node_modules/@vue/cli-service/lib/commands/build/index.js:124:50)
    at api.registerCommand (/Users/kory/Publift/publift-chrome-extension/node_modules/@vue/cli-service/lib/commands/build/index.js:72:13)
    at Service.run (/Users/kory/Publift/publift-chrome-extension/node_modules/@vue/cli-service/lib/Service.js:207:12)
    at Object.<anonymous> (/Users/kory/Publift/publift-chrome-extension/node_modules/@vue/cli-service/bin/vue-cli-service.js:22:9)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)

Output 2

⠴  Building for development...
[object Object]
    at api.configureWebpack (/Users/kory/Publift/publift-chrome-extension/node_modules/vue-cli-plugin-browser-extension/index.js:35:13)
    at webpackRawConfigFns.forEach.fn (/Users/kory/Publift/publift-chrome-extension/node_modules/@vue/cli-service/lib/Service.js:227:21)
    at Array.forEach (<anonymous>)
    at Service.resolveWebpackConfig (/Users/kory/Publift/publift-chrome-extension/node_modules/@vue/cli-service/lib/Service.js:224:30)
    at Object.<anonymous> (/Users/kory/Publift/publift-chrome-extension/node_modules/@vue/cli-service/webpack.config.js:12:26)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.exports.resolve (/Users/kory/Publift/publift-chrome-extension/node_modules/eslint-import-resolver-webpack/index.js:69:25)
    at v2 (/Users/kory/Publift/publift-chrome-extension/node_modules/eslint-module-utils/resolve.js:94:23)
    at withResolver (/Users/kory/Publift/publift-chrome-extension/node_modules/eslint-module-utils/resolve.js:99:16)
    at fullResolve (/Users/kory/Publift/publift-chrome-extension/node_modules/eslint-module-utils/resolve.js:116:22)

Let me know if there is anything else I can provide, would really like to get this working.

korziee commented 6 years ago

Just so I can move on with the project i'm working on, i've created a real quick and dirty fix. https://github.com/Publift/vue-cli-plugin-browser-extension/commit/876eebe075fc81f9b5f792c5285e2f85b872e122

adambullmer commented 5 years ago

I think this has been resolved with the use of webpack-extension-reloader instead of the chrome specific one. Was just released, tonight in 0.16.0. Any feedback would be greatly appreciated on whether this fixes the issue for you or not.

adambullmer commented 5 years ago

closing due to inactivity and presumed resolution