Skip to content

fix: sqlite3.wasm uses relative URI — breaks path URL strategy #46

@anilcancakir

Description

@anilcancakir

Bug

connection_factory_web.dart:41 loads the WASM binary with a relative URI:

_sqlite3 ??= await WasmSqlite3.loadFromUrl(Uri.parse('sqlite3.wasm'));

When using usePathUrlStrategy() (routing config url_strategy: path), the browser resolves this relative to the current page path. For example, navigating to /projects/abc/chats/ causes the request:

GET /projects/abc/chats/sqlite3.wasm → 404

Instead of the correct:

GET /sqlite3.wasm → 200

Fix

Use an absolute path:

_sqlite3 ??= await WasmSqlite3.loadFromUrl(Uri.parse('/sqlite3.wasm'));

File

lib/src/database/connectors/connection_factory_web.dart:41

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions