-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
UnknownError - sqlite3.oo1.OpfsDb is not a constructor #147
Comments
You have to add COOP and COEP HTTP Headers as described in https://sqlite.org/wasm/doc/trunk/persistence.md#coop-coep In Next.js, add /** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
// ADD THIS:
async headers() {
return [
{
source: "/(.*?)",
headers: [
{
key: "cross-origin-embedder-policy",
value: "require-corp",
},
{
key: "cross-origin-opener-policy",
value: "same-origin",
},
],
},
];
},
};
module.exports = nextConfig; |
Is there any recommended way to force Patching For |
Type module or tsconfig are irrelevant. You have to enable https://sqlite.org/wasm/doc/trunk/persistence.md#coop-coep. Of course, I can add an option to enforce LocalStorage, but OPFS should work, or my detection is wrong. Maybe this will help https://github.com/mandolyte/sqlitenext#opfs_db (there is a link to vercel/next.js#17991 |
The problem is that Solution:const headers = [
{
key: 'cross-origin-embedder-policy',
value: 'require-corp',
},
{
key: 'cross-origin-opener-policy',
value: 'same-origin',
},
]
const nextConfig = {
// ADD THIS:
async headers() {
return [
{
source: '/',
headers,
},
{
source: '/(.*?)',
headers,
},
]
},
}; |
@FilipChalupa Thank you, it will help others. |
Why?
The text was updated successfully, but these errors were encountered: