Skip to content

Navigation Menu

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

Appearance settings

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

Copy link
Copy link
Open
@AutistiCoder

Description

@AutistiCoder
Issue body actions

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.