-
Notifications
You must be signed in to change notification settings - Fork 1.2k
"assert is not defined" in Electron #852
Comments
<script src="https://unpkg.com/ipfs/dist/index.js"></script> const ipfs = Ipfs() throws this error, again, only in Electron window Uncaught TypeError: createServer is not a function
at module.exports (listener.js:9)
at WebSockets.createListener (index.js:43)
at transport.js:86
at parallel.js:27
at eachOfArrayLike (eachOf.js:61)
at exports.default (eachOf.js:9)
at _parallel (parallel.js:26)
at parallelLimit (parallel.js:87)
at Object.listen (transport.js:106)
at each (index.js:90) |
@negamaxi it is important to understand which process of electron you are using, is it the Node.js process or the Browser process? |
@diasdavid ipfs code served by webpack on 'http://localhost:8080'. Electron opens this address in a new window. That means browser process, I guess. mainWindow = new BrowserWindow({width: 800, height: 600})
const URL = 'http://localhost:8080'
mainWindow.loadURL(URL) Same page opened in Chrome in parallel works just fine. |
Reproduced on pure electron-quickstart-app here https://github.com/negamaxi/electron-ipfs-quick-start . IPFS added with script tag and initialized in renderer.js. Throws createServer error already mentioned above. When added via npm throws something new: Uncaught Error: Cannot find module '/mnt/sda5/Projects/electron-ipfs-quick-start/node_modules/wrtc/build/wrtc/v0.0.61/Release/electron-v1.6-linux-x64/wrtc.node'
at Module._resolveFilename (module.js:470)
at Function.Module._resolveFilename (/mnt/sda5/Projects/electron-ipfs-quick-start/node_modules/electron/dist/resources/electron.asar/com…:35)
at Function.Module._load (module.js:418)
at Module.require (module.js:498)
at require (internal/module.js:20)
at Object.<anonymous> (/mnt/sda5/Projects/electron-ipfs-quick-start/node_modules/wrtc/lib/peerconnection.js:6)
at Object.<anonymous> (/mnt/sda5/Projects/electron-ipfs-quick-start/node_modules/wrtc/lib/peerconnection.js:419)
at Module._compile (module.js:571)
at Object.Module._extensions..js (module.js:580)
at Module.load (module.js:488) It maybe somehow connected with this errors occured during installation. node-pre-gyp ERR! Tried to download(404): https://node-webrtc.s3.amazonaws.com/wrtc/v0.0.61/Release/node-v51-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for wrtc@0.0.61 and node@7.10.0 (node-v51 ABI) (falling back to source compile with node-gyp)
` |
Hi! I started working on electron support, track it in #843 |
Let's convert our focus on #843 |
Simple webpack bundle with this two lines:
...throws this in Electron app.
Same code works well in Chrome tab. First I assumed something wrong with webpack bundle, but cdn bundle of ipfs-iiif-db embeded with <script> tag also refuses to work in Electron.
webpack 2.3.3 + webpack dev server 2.4.2 + electron 1.6.2 + ipfs 0.23.1
The text was updated successfully, but these errors were encountered: