Skip to content
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

Error when using OPFS StorageManager API with pyodide nativeFS API in FireFox Mozilla #5196

Open
airen1986 opened this issue Nov 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@airen1986
Copy link
Contributor

🐛 Bug

We are getting error when accessing OPFS SQLite database using storage manager API with nativeFS in Firefox Mozilla, same is working without any issues in Chrome/Edge in windows

To Reproduce

JS Code:

  let root = await navigator.storage.getDirectory();
  let dirHandleMount = await root.getDirectoryHandle('data', { create: true });

  self.pyodide = await loadPyodide({
    indexURL:"https://cdn.jsdelivr.net/pyodide/v0.26.2/full",
  });

  await self.pyodide.loadPackage(["micropip", "sqlite"]);
  await self.pyodide.mountNativeFS("/mnt/nativefs", dirHandleMount);
  await self.pyodide.runPythonAsync(package_code);
};

Python Code:

import sqlite3
conn = sqlite3.connect('/mnt/nativefs/Default/MT_4.sqlite3')

for row in conn.execute("SELECT * FROM sqlite_master"):
  print(row)
conn.close()

Expected behavior

It should run error free as it did in Chrome/Edge.

Environment

  • Pyodide Version : 0.26.2
  • Browser version : Firefox 133.0b4 (64-bit)
  • OS: Windows 11
@airen1986 airen1986 added the bug Something isn't working label Nov 13, 2024
@ryanking13
Copy link
Member

ryanking13 commented Nov 19, 2024

Thanks for the report. What kind of error message do you get?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants