Giter Club home page Giter Club logo

Comments (49)

jman13378 avatar jman13378 commented on August 15, 2024 1
import _ from "lodash";

window["privateLocalStorage"] = window.localStorage;
delete window.clearInterval;

const Twetzel = {
  /** General Objects */
  5858: {
    /** */ 1: Object,
    /** .*/ 2: Object,
    /** */ 3: Object,
    /** */ 4: Object,
    /** */ 5: Object,
    /** */ 6: Object,
    /** */ 7: Object,
    /** */ 8: Object,
    /** */ 9: Object,
    /** */ 10: Object,
    /** */ 213: Object,
    /** */ 424: Object,
    /** */ 5643: Object,
    /** */ 64353: Object,
  },
  /** Valuables */
  5888: {
    /** */ 565: Object,
    /** */ 56564: Object,
    /** */ 347: Object,
    /** */ 1234: Object,
    /** */ 126: Object,
    /** */ 2454: Object,
  },
};
window["Twetzel"] = Twetzel;

window.Twetzel[5888][565] = window.privateLocalStorage;
delete window.privateLocalStorage;
window.Twetzel[5858][1] = require("ejs");

const fr = require("browserfs");
fr.configure({ fs: "LocalStorage" });

delete window.localStorage;

window.Twetzel[5858][3] = fr.BFSRequire("fs");

window.Twetzel[5858][2] = require("socket.io-client");

window.Twetzel[5888][56564] = window.Twetzel[5858][2]("dashboard.sokobot.info/");
console.log(window.Twetzel);
require("./socket/socket")(window.Twetzel[5888][56564]);

console.log("e");

window["messages"] = document.getElementById("messages");
var form = document.getElementById("form");
//var loginform = document.getElementById("loginf");
//var signupform = document.getElementById("signupf");

var msg = document.getElementById("input");
/*form.addEventListener("submit", function (e) {
  e.preventDefault();

  if (input.value) {
    if (input.value.includes("\\")) {
      input.value = "";
      return;
    }
    let data = JSON.parse(decodeBase64(localStorage.getItem("data")));
    console.log(data);
    socket.emit("chat message", `{"message": "${input.value}", "id": "${data.username}"}`);
    input.value = "";
  }
});*/

/*`
<iframe frameBorder="0" src="login.html" style="
width: 100%;
height: 100%;
position: fixed;
z-index: 1;
"></iframe>`,
*/

its here the error is coming from the configure

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

@jman13378 Which version of browserfs are you using?

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

idk latest

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

If you're using the latest from NPM, it will not have the latest bug fixes and features. Please read Releases and compatibility going forward.

Try building it from source. That should fix the issue:

git clone https://github.com/jvilk/BrowserFS
cd BrowserFS
npm i
npm run build

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

where do i clone it, anywhere, in the root of the project, in the node_modules of the project

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

Please clone it in a separate directory. You can then symlink the BrowserFS in node_modules to it.

For example (from your project):

cd ..
git clone https://github.com/jvilk/browserfs
cd browserfs 
npm i
npm run build
cd ../your-project
rm -rf node_modules/browserfs
ln -s ../browserfs node_modules/browserfs

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

now when i run my build command i get this

Error
ERROR in ./node_modules/debug/src/browser.js 226:18-25
Module not found: Error: Can't resolve 'processGlobal' in 'D:\webpack\node_modules\debug\src'
 @ ./node_modules/socket.io-client/build/cjs/index.js 12:32-48
 @ ./src/index.js 47:38-65

ERROR in ./node_modules/filer/lib/async.js 15:15-22
Module not found: Error: Can't resolve 'processGlobal' in 'D:\webpack\node_modules\filer\lib'
 @ ./node_modules/filer/src/shell/shell.js 5:12-41
 @ ./node_modules/filer/src/index.js 11:9-36
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/node_modules/schema-utils/dist/validate.js 133:6-13
Module not found: Error: Can't resolve 'processGlobal' in 'D:\webpack\node_modules\filer\node_modules\schema-utils\dist'
 @ ./node_modules/filer/node_modules/schema-utils/dist/index.js 9:4-25
 @ ./node_modules/filer/src/webpack-plugin/utils.js 1:19-42
 @ ./node_modules/filer/src/webpack-plugin/index.js 2:12-30
 @ ./node_modules/filer/src/index.js 21:22-49
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/src/filesystem/implementation.js 707:17-23
Module not found: Error: Can't resolve 'bufferGlobal' in 'D:\webpack\node_modules\filer\src\filesystem'
 @ ./node_modules/filer/src/filesystem/interface.js 32:13-43
 @ ./node_modules/filer/src/index.js 5:14-50
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/src/filesystem/interface.js 81:9-15
Module not found: Error: Can't resolve 'bufferGlobal' in 'D:\webpack\node_modules\filer\src\filesystem'
 @ ./node_modules/filer/src/index.js 5:14-50
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/src/index.js 6:10-16
Module not found: Error: Can't resolve 'bufferGlobal' in 'D:\webpack\node_modules\filer\src'
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/src/path.js 5:0-7
Module not found: Error: Can't resolve 'processGlobal' in 'D:\webpack\node_modules\filer\src'
 @ ./node_modules/filer/src/index.js 8:8-28 9:8-28
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/src/providers/indexeddb.js 61:19-25
Module not found: Error: Can't resolve 'bufferGlobal' in 'D:\webpack\node_modules\filer\src\providers'
 @ ./node_modules/filer/src/providers/index.js 1:18-43
 @ ./node_modules/filer/shims/providers/default.js 1:20-56
 @ ./node_modules/filer/shims/fs.js 5:13-34 8:13-43
 @ ./node_modules/ejs/lib/ejs.js 48:9-22
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/src/webpack-plugin/processors.js 4:12-19
Module not found: Error: Can't resolve 'processGlobal' in 'D:\webpack\node_modules\filer\src\webpack-plugin'
 @ ./node_modules/filer/src/webpack-plugin/index.js 7:27-50
 @ ./node_modules/filer/src/index.js 21:22-49
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/path/path.js 25:16-23
Module not found: Error: Can't resolve 'processGlobal' in 'D:\webpack\node_modules\path'
 @ ./node_modules/filer/src/path.js 12:17-32
 @ ./node_modules/filer/src/index.js 8:8-28 9:8-28
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/util/util.js 73:6-13
Module not found: Error: Can't resolve 'processGlobal' in 'D:\webpack\node_modules\util'
 @ ./node_modules/path/path.js 26:11-26
 @ ./node_modules/filer/src/path.js 12:17-32
 @ ./node_modules/filer/src/index.js 8:8-28 9:8-28
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/engine.io-client/build/cjs/transports/websocket.js 96:51-57
Module not found: Error: Can't resolve 'bufferGlobal' in 'D:\webpack\node_modules\engine.io-client\build\cjs\transports'
 @ ./node_modules/engine.io-client/build/cjs/transports/index.js 5:23-48
 @ ./node_modules/engine.io-client/build/cjs/index.js 9:17-49
 @ ./node_modules/socket.io-client/build/cjs/url.js 7:27-54
 @ ./node_modules/socket.io-client/build/cjs/index.js 7:17-36
 @ ./src/index.js 47:38-65

ERROR in ./node_modules/ajv-keywords/keywords/instanceof.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/ajv-keywords/keywords/index.js 4:16-39
 @ ./node_modules/ajv-keywords/index.js 3:15-36
 @ ./node_modules/filer/node_modules/schema-utils/dist/validate.js 58:22-45
 @ ./node_modules/filer/node_modules/schema-utils/dist/index.js 9:4-25
 @ ./node_modules/filer/src/webpack-plugin/utils.js 1:19-42
 @ ./node_modules/filer/src/webpack-plugin/index.js 2:12-30
 @ ./node_modules/filer/src/index.js 21:22-49
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/debug/src/browser.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/socket.io-client/build/cjs/index.js 12:32-48
 @ ./src/index.js 47:38-65

ERROR in ./node_modules/filer/lib/async.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/filer/src/shell/shell.js 5:12-41
 @ ./node_modules/filer/src/index.js 11:9-36
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/node_modules/schema-utils/dist/validate.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/filer/node_modules/schema-utils/dist/index.js 9:4-25
 @ ./node_modules/filer/src/webpack-plugin/utils.js 1:19-42
 @ ./node_modules/filer/src/webpack-plugin/index.js 2:12-30
 @ ./node_modules/filer/src/index.js 21:22-49
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/src/filesystem/implementation.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/filer/src/filesystem/interface.js 32:13-43
 @ ./node_modules/filer/src/index.js 5:14-50
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/src/filesystem/interface.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/filer/src/index.js 5:14-50
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/src/index.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/src/path.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/filer/src/index.js 8:8-28 9:8-28
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/src/providers/indexeddb.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/filer/src/providers/index.js 1:18-43
 @ ./node_modules/filer/shims/providers/default.js 1:20-56
 @ ./node_modules/filer/shims/fs.js 5:13-34 8:13-43
 @ ./node_modules/ejs/lib/ejs.js 48:9-22
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/filer/src/webpack-plugin/processors.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/filer/src/webpack-plugin/index.js 7:27-50
 @ ./node_modules/filer/src/index.js 21:22-49
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/path/path.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/filer/src/path.js 12:17-32
 @ ./node_modules/filer/src/index.js 8:8-28 9:8-28
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/util/util.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/path/path.js 26:11-26
 @ ./node_modules/filer/src/path.js 12:17-32
 @ ./node_modules/filer/src/index.js 8:8-28 9:8-28
 @ ./node_modules/filer/shims/path.js 1:17-40
 @ ./node_modules/ejs/lib/ejs.js 50:11-26
 @ ./src/index.js 38:38-52

ERROR in ./node_modules/engine.io-client/build/cjs/transports/websocket.js
Cannot read properties of undefined (reading 'module')
 @ ./node_modules/engine.io-client/build/cjs/transports/index.js 5:23-48
 @ ./node_modules/engine.io-client/build/cjs/index.js 9:17-49
 @ ./node_modules/socket.io-client/build/cjs/url.js 7:27-54
 @ ./node_modules/socket.io-client/build/cjs/index.js 7:17-36
 @ ./src/index.js 47:38-65

26 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.88.2 compiled with 26 errors in 9865 ms

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

I don't see any issues with BrowserFS. What does index.js look like?

I recently removed the various polyfills exported by BrowserFS (path, process, buffer, etc.). The change was made because BrowserFS is not intended to polyfill those APIs. If you need to polyfill them, you can install a polyfill separately. Moreover, the polyfills used (bfs-path, bfs-process, etc.) were old and did not support the standard APIs correctly.

Those polyfills may have defined the missing globalName variables, which would have led to those errors. Regardless, having the index.js code would help me understand the problem better.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024
import _ from "lodash";

window["privateLocalStorage"] = window.localStorage;
delete window.clearInterval;

const Twetzel = {
  /** General Objects */
  5858: {
    /** */ 1: Object,
    /** .*/ 2: Object,
    /** */ 3: Object,
    /** */ 4: Object,
    /** */ 5: Object,
    /** */ 6: Object,
    /** */ 7: Object,
    /** */ 8: Object,
    /** */ 9: Object,
    /** */ 10: Object,
    /** */ 213: Object,
    /** */ 424: Object,
    /** */ 5643: Object,
    /** */ 64353: Object,
  },
  /** Valuables */
  5888: {
    /** */ 565: Object,
    /** */ 56564: Object,
    /** */ 347: Object,
    /** */ 1234: Object,
    /** */ 126: Object,
    /** */ 2454: Object,
  },
};
window["Twetzel"] = Twetzel;

window.Twetzel[5888][565] = window.privateLocalStorage;
delete window.privateLocalStorage;
window.Twetzel[5858][1] = require("ejs");

const fr = require("browserfs");
fr.configure({ fs: "LocalStorage" });

delete window.localStorage;

window.Twetzel[5858][3] = fr.BFSRequire("fs");

window.Twetzel[5858][2] = require("socket.io-client");

window.Twetzel[5888][56564] = window.Twetzel[5858][2]("dashboard.sokobot.info/");
console.log(window.Twetzel);
require("./socket/socket")(window.Twetzel[5888][56564]);

console.log("e");

window["messages"] = document.getElementById("messages");
var form = document.getElementById("form");
//var loginform = document.getElementById("loginf");
//var signupform = document.getElementById("signupf");

var msg = document.getElementById("input");
/*form.addEventListener("submit", function (e) {
  e.preventDefault();

  if (input.value) {
    if (input.value.includes("\\")) {
      input.value = "";
      return;
    }
    let data = JSON.parse(decodeBase64(localStorage.getItem("data")));
    console.log(data);
    socket.emit("chat message", `{"message": "${input.value}", "id": "${data.username}"}`);
    input.value = "";
  }
});*/

/*`
<iframe frameBorder="0" src="login.html" style="
width: 100%;
height: 100%;
position: fixed;
z-index: 1;
"></iframe>`,
*/

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

You are getting the errors because you are mixing CommonJS and ESM modules... You will have to use one or the other.

You also appear to be attempting to use DOM/browser APIs while using NPM modules and Node's require. Again, you will have to choose one (or use a bundler, which I recommend).

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

to me it looks like im only using CommonJS modules

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

Literally the first line is ESM: import _ from "lodash";

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

that was from webpack i never removed it

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

I recently removed the various polyfills exported by BrowserFS (path, process, buffer, etc.). The change was made because BrowserFS is not intended to polyfill those APIs. If you need to polyfill them, you can install a polyfill separately. Moreover, the polyfills used (bfs-path, bfs-process, etc.) were old and did not support the standard APIs correctly.

Those polyfills may have defined the missing globalName variables, which would have led to those errors. Regardless, having the index.js code would help me understand the problem better.

You can't use browserfs shims, as they have been removed. You should use a polyfill.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

Alright sorry for the late response im now getting this error in the browser console Uncaught TypeError: e is not a function

full error
main.js:2 Uncaught TypeError: e is not a function
    at main.js:2:323624
    at e.Create (main.js:2:245815)
    at main.js:2:322032
    at V (main.js:2:181078)
    at forEach.t.Create (main.js:2:322004)
    at a (main.js:2:322620)
    at fo (main.js:2:322967)
    at e.configure (main.js:2:323595)
    at main.js:2:712605
    at main.js:2:713077
Code from error: from webpack
e.install = function(e) {
                            e.Buffer = t,
                            e.process = a;
                            var r = e.require ? e.require : null;
                            e.require = function(t) {
                                return co(t) || r.apply(null, Array.prototype.slice.call(arguments, 0))
                            }
                        }
                        ,
                        e.registerFileSystem = function(t, e) {
                            so[t] = e
                        }
                        ,
                        e.BFSRequire = co,
                        e.initialize = uo,
                        e.configure = function(t, e) {
                            fo(t, (function(t, r) {
                                r ? (uo(r),
                                e()) : e(t) // this was the line of the error
                            }
                            ))
                        }
                        ,
                        e.getFileSystem = fo,
                        e.EmscriptenFS = K,
                        e.FileSystem = so,
                        e.Errors = p,
                        e.setImmediate = Ir
                    }
                    ).call(e, r(1), function() {
                        return this
                    }(), r(5)(t), r(6))

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

@jman13378

I'm able to build and use BFS fine locally. Are you building from the latest commit or installing from NPM? If your building correctly, you may need to fix your import syntax.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

i am using

Please clone it in a separate directory. You can then symlink the BrowserFS in node_modules to it.

For example (from your project):

cd ..
git clone https://github.com/jvilk/browserfs
cd browserfs 
npm i
npm run build
cd ../your-project
rm -rf node_modules/browserfs
ln -s ../browserfs node_modules/browserfs

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

Can you please get the errors from source? The error message is from the minified code, and does not help me understand the problem. Using a source map would be very helpful

Is there anywhere I can take a look at your code?

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

What is the error stack in source (not the minified code)?

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

how do i find that

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

BrowserFS builds a sourcemap, so you should be able to run your code from source to use the sourcemap.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024
Uncaught TypeError: e is not a function
    at browserfs.js:15651:14
    at e.Create (browserfs.js:9772:10)
    at browserfs.js:15577:25
    at V (browserfs.js:2043:10)
    at forEach.t.Create (browserfs.js:15580:10)
    at a (browserfs.js:15679:22)
    at fo (browserfs.js:15712:10)
    at e.configure (browserfs.js:15648:6)
    at index.js:41:4
    at index.js:60:35
	/**
	 * Creates a file system with the given configuration, and initializes BrowserFS with it.
	 * See the FileSystemConfiguration type for more info on the configuration object.
	 */
	function configure(config, cb) {
	    getFileSystem(config, function (e, fs) {
	        if (fs) {
	            initialize(fs);
	            cb(); // this is the error line
	        }
	        else {
	            cb(e);
	        }
	    });
	}

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

That is not the most updated version. You probably need to do a git pull and rebuild BrowserFS.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

image

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

The latest commit at the time of writing is 739ee5a. You may also need to do git fetch --all before pulling. 13c8da9 is not a commit in the repository. You should double check you are working in the right repository (Try git remote show origin and check that the URLs point to github.com/jvilk/browserfs)

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

i think the problem is when i use npm install in the root project it will update the module to the latest on npm instead of keeping the one installed should i fix this by removing it from the package.json

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

Do not use npm install after symlinking BFS to your local project. If you do, then you have to remove the installed BFS and symlink the local repository again.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

alright im now getting this after using patch-package

Uncaught TypeError: n.configure is not a function
    at index.js:41:4
    at index.js:60:35
    at index.js:60:35

thsi is the code
image

this solution was provided by Cloudflare discord (message)

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

It is probably because you are using require and because of this:

package.json:

{
    ...
    "exports": {
        ".": {
            "require": "./dist/browserfs.min.js",
            "import": "./dist/browserfs.min.mjs"
        }
    },
    ...
}

scripts/build.mjs

//...
const configs = {
	'browser, unminified': { outfile: 'dist/browserfs.js' },
	'browser, minified': { outfile: 'dist/browserfs.min.js', minify: true }, // <- this is UMD!
	'ESM, unminified': { outfile: 'dist/browserfs.mjs', format: 'esm' },
	'ESM, minified': { outfile: 'dist/browserfs.min.mjs', format: 'esm', minify: true },
	node: { outfile: 'dist/browserfs.cjs', platform: 'node', format: 'cjs', minify: true, alias: {}, plugins: [] },
};
//...

I've fixed it so it should work now (8c574b3). I apologize for taking so long to find and fix the bug.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

so i just need to recompile the latest version?

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

Yes, make sure you fetch and pull first.

If you are not familiar with git, I highly recommend you watch this video.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

i love git lmao

give me like 5 min had some issues with pulling/pushing to my repo

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

Uncaught (in promise) Error: Error: ENOSPC: LocalStorage is full.

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

That is because you delete window.localStorage.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

can I make LocalStorage have a custom variable

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

alright after switching to HTTPRequest i get this

browserfs.min.cjs:6 Uncaught (in promise) Error: Error: EIO: Unexpected token '<', "  <!DOCTYPE "... is not valid JSON
    at Ut (browserfs.min.cjs:6:4780)

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

That is most likely because you are making a request to an endpoint (e.g. example.com/endpoint) which returns an HTML document, and BFS attempts to parse the body as JSON. Could you please get an error stack with the source? (the files should have a .ts extensions).

This is probably an error with BrowserFS.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

where do i get those files
also i didnt even request anything (as in like BFS.readFile())

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

The files are in your local clone of BFS.

If you're using Typescript, import from the BFS src directory (e.g. import <stuff> from 'browserfs/src/<file path>.ts').

If not, make sure to use the source maps (run your code from the source).

I think this may have to do with the internal fetch usage and response.json, so I will take a look at that.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

browserfs.zip
these are the files that are used when running the site (browserfs/dist),the one that throws the error is browserfs.min.cjs:6:4780

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

Please use the browserfs.cjs (which is unminified). Doing so will help me find and fix the problem faster.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

the error is in the return line

  writeFile(fname, data, encoding, flag, mode, cred) {
    return this._rpc("writeFile", fname, data, encoding, flag, mode, cred);
  }

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

That code appears to be from WorkerFS. Could you please provide the stack trace?

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

Sorry for the delayed response, but it looks like it doesnt error anymore but when i use the read/write methods nothing happens

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

Is your code on GitHub? If so, you can point me to it and I can try to reproduce the issue.

from browserfs.

jman13378 avatar jman13378 commented on August 15, 2024

https://github.com/jman13378/webpack its in src/index.js

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

@jman13378 Please try with the updates I've made to your configuration in this PR.

from browserfs.

dr-vortex avatar dr-vortex commented on August 15, 2024

I'm going to close this issue since I can't reproduce the bug with a proper configuration.

from browserfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.