Problem with packaging GUN application using pkg
Hi!
I'm developing an app which requires me to package my gun app using pkg.
The app loads successfully, but every 2 seconds or so I get this error
Error: Cannot write to packaged file
at writeToSnapshot (pkg/prelude/bootstrap.js:964:16)
at Object.write (pkg/prelude/bootstrap.js:980:12)
at writeAll (node:fs:2126:6)
at node:fs:2191:7
at zalgoSafe (pkg/prelude/bootstrap.js:432:10)
at pkg/prelude/bootstrap.js:766:9
at FSReqCallback.oncomplete (node:fs:201:23)
Here's the code
// gun-server.js
const Gun = require('gun');
require('gun/sea');
require('gun/lib/webrtc');
const http = require('http');
const server = http.createServer().listen(8765);
Gun({ web: server });
console.log('🔫 GunDB peer running at http://localhost:8765/gun');
Terminal
nothing too complicated. how do i resolve this error?
any updates?
@LAKSHYAJAIN16 I don't know what pkg is but guessing it ZIPs gun and then does not like that GUN tries to save data.
So, IDK, you can either run GUN in-memory only (prob not what you want), or complain to pkg to allow data to be saved?
Will close soon, cause this doesn't seem to be a bug with GUN, GUN is doing what it needs to do: saving data to disk.
@amark yeah, pkg is just bundling the application into an executable. even after disabling the radisk attribute it wasn't bundling. was wondering if there was some debugging/metadata storage going on.