question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Where do I get sql-wasm.wasm ?

See original GitHub issue

Hi! Really excited by this project. I’m trying it out locally, using the directions in the readme, and my browser’s making a request for /js/sql-wasm.wasm which throws a 404 as it doesn’t exist. Not sure what’s calling it, or where it’s supposed to be. Any suggestions?

I see it as a static file in the example repo, but the readme doesn’t mention it 🤔

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
quolprcommented, Jul 11, 2022

Overall, it’s not a good practice to copy wasm file to your public dir, then you will lose ability to receive updates. It’s better to import from lib. Here how you can do with CRA:

import sqlWasmUrl from "@jlongster/sql.js/dist/sql-wasm.wasm";

Or with vite:

import sqlWasmUrl from "@trong-orm/sql.js/dist/sql-wasm.wasm?url";

Also, this might help you https://trong-orm.netlify.app/core/usage https://trong-orm.netlify.app/backends/web (it’s an abstraction layer, that makes it easier to use absurd-sql. There is also CRA and vite repo example)

2reactions
adv1996commented, Nov 8, 2021

Hey @timwis I just downloaded the .wasm file from the examples folder.

https://github.com/jlongster/absurd-sql/blob/master/src/examples/sql-wasm.wasm

In my react application where I’m testing this library I put it in the public/wasm/bin folder and it works. When I initialize it with initSQLJs it looks like this

SQL = await initSqlJs({ locateFile: file => `/wasm/bin/${file}` });

Read more comments on GitHub >

github_iconTop Results From Across the Web

sql-wasm - npm
SQLite compiled to WebAssembly through Emscripten.. Latest version: 1.1.4, last published: 4 years ago. Start using sql-wasm in your project ...
Read more >
SQL-WASM.WASM: DOWNLOAD - CDNPKG .com
Download sql-wasm.wasm or get a CDN url for 5 versions of sql.js.
Read more >
SQL Databases in the Browser, via WASM: SQLite and DuckDB
In this post, I'll review a couple of WASM compiled databses that you can run purely within a browser: SQLite and Duck.db. SQLite....
Read more >
About the sqlite3 WASM/JS Subproject
Alon Zakai's sql.js was an essential stepping stone in this code's development as it demonstrates how to handle some of the WASM-related voodoo...
Read more >
SQLite in Browser using WebAssembly - Vivek Kumar Bansal
sql.js comes with two builds, a debug build and a production build. The debug build can be found at sql.js/dist/sql ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found