Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How do I use SQL.js in a React app? #612

Open
@AutistiCoder

Description

Hello,

I am trying to use SQL.js within an existing React app.

I tried using the sql-js NPM package and loading SQL.js like so:

import initSqlJs from "sql.js";
await initSqlJs({
 locateFile: (file) => `https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.6.2/${file}` // this was in an async function
 });

and got this error at runtime:

./node_modules/sql.js/dist/sql-wasm.js:94:15
Module not found: Can't resolve 'fs'

I saw the demo repository but can't make heads or tails of it!

Any help would be greatly appreciated.

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

        AltStyle によって変換されたページ (->オリジナル) /