daniegarcia254 / Framework7-Vue-Webpack-Cordova

MIT License
19 stars 6 forks source link

ERROR in ./webpack/dev_helpers/CordovaDeviceRouter.js #1

Open l4cr0ss opened 6 years ago

l4cr0ss commented 6 years ago

I receive the following error when issuing the command HOST="0.0.0.0" PORT="6000" npm run hot-dev

ERROR in ./webpack/dev_helpers/CordovaDeviceRouter.js
Module not found: Error: Can't resolve 'device.js' in '/home/jehudson/projects/Framework7-Vue-Webpack-Cordova/webpack/dev_helpers'
 @ ./webpack/dev_helpers/CordovaDeviceRouter.js 1:17-37
 @ multi (webpack)-dev-server/client?http://0.0.0.0:6000 webpack/hot/dev-server ./src/main.js ./webpack/dev_helpers/CordovaDeviceRouter.js

I followed the setup guide in the README, deviating only when installing the cordova browser. (I issued the command cordova platform add browser instead of the command cordova platform add browser android, because I was running into some issues there. Ultimately I got the Android platform installed anyway).

OS: Ubuntu 16.04.2 LTS (xenial)

BillMeyerRSA commented 4 years ago

Have similar issue. Must run on localhost or nothing. Everything else no compile. Giving up on this. If something as simple as this is broken for years not wanting to see what other problems will come up. Ubuntu 18.04 server.

daniegarcia254 commented 4 years ago

I'm not able to check right now if it works, but I think that this would be solved by replacing the device.js module (not-existing anymore) for the current-device module. It is from the same author.

So, in the project root, execute:

npm remove device.js npm i --save current-device

Finally, in the file CordovaDeviceRouter.js use the new current-devicemodule instead of device.js:

const deviceJs = require('current-device').default;

scotthooker commented 3 years ago

Port 6000 is a protected port used for other things as such can't be used for localhost.

The following are the restricted ports on chrome and considered unsafe so won't work for your use.

Source: https://chromium.googlesource.com/chromium/src.git/+/refs/heads/main/net/base/port_util.cc

Maybe the same here...