-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
path.join throw error in Service Worker #291
Comments
@jcubic Please try with the latest commit. If it still does not work, a PR would be greatly appreciated! |
Will check, is the latest version published to NPM? |
@jcubic I don't believe so. You will need to clone the repo and build from source. |
ok, will see if I will be able to test tomorrow. I'm on a trip but got a laptop with me. |
I'm not able to build the project got error from NodeJS:
This seems to be a common NodeJS error but I'm not able to solve it by adding:
|
Interesting... I don't believe that error is related to BrowserFS so it is most likely with your machine. |
This is common error with Node and the library failed to handle it properly. sent from Android12.03.2023 2:20 AM "Dr. Vortex" ***@***.***> napisał(a):
Interesting... I don't believe that error is related to BrowserFS so it is most likely with your machine.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@james-pre thanks it works, I think that I've missed this. But I think that all those errors are problems with the library that doesn't support the latest NodeJS. I have the same with a project I'm maintaining and this is my project's fault that this throws an error and requires disabling security hacks to work. |
@jcubic I'm working on updating all of BrowserFS' various dependencies so it should get fixed soon. |
I've added browserFS build file to my project that uses service worker and I've got a different error:
from The whole code was working fine. This my setup: self.addEventListener('fetch', function (event) {
let path = BrowserFS.BFSRequire('path');
let fs = new Promise(function(resolve, reject) {
BrowserFS.configure({ fs: 'IndexedDB', options: {} }, function (err) {
if (err) {
reject(err);
} else {
resolve(BrowserFS.BFSRequire('fs'));
}
});
});
event.respondWith(fs.then(function(fs) {
// ...
});
}); I'm not sure if the API changed. If I changed the app to also use new BrowserFS that app stops working and throws an error on What are the breaking changes in 2.0? |
As for the error, I'm not entirely sure why it is being thrown. I would suggest you change the code to use I will look into the error more in the mean time (and hopefully fix the |
Thanks, Will check my app with the latest version. |
The ls command works but when I want to clone the repo. Got an error from this function: AsyncKeyValueFileSystem.prototype.getDirListing = function getDirListing (tx, p, inode, cb) {
if (!inode.isDirectory()) {
cb(ApiError.ENOTDIR(p));
}
else {
tx.get(inode.id, function (e, data) {
if (noError(e, cb)) {
try {
cb(null, JSON.parse(data.toString()));
}
catch (e) {
// Occurs when data is undefined, or corresponds to something other
// than a directory listing. The latter should never occur unless
// the file system is corrupted.
cb(ApiError.ENOENT(p));
}
}
});
}
};
Also, I needed to delete the old database because it was not compatible and was throwing errors. |
Closing (stale). If you would like to reopen this issue, please do so by creating a new issue in the relevant repositories of @browser-fs |
If you call this path.join('/'. 'file') in service worker it throw exception:
it work outside of worker.
The text was updated successfully, but these errors were encountered: