Closed Quacken8 closed 4 months ago
Vite does let me build the project, however I'd love to use SQLocal in projects that use fs
and other node modules that cannot be built for the browser
Am I correct in understanding that you are trying to run SQLocal in Node.js? SQLocal is for running a SQLite database in the browser. It does not work on the server side.
I'm trying to use sqlite in a vscode extension and those run in node. Most sqlite solutions use native modules which may create issues with compatibility and since sqlocal builds to wasm I hoped it would be a better option
SQLite WASM does not support Node.js since its storage mechanism is implemented with the Origin Private File System API, which is not supported by Node.js. I think SQLite WASM may be working on a second storage implementation with Node.js support, but for now, it's a browser-only solution.
Depending on what your VSCode extension is meant to do, you may still be able to use SQLocal as long as you do it in a context where the code is being run by VSCode's Chromium engine, not Node.js, such as in a webview.
There is some issue with importing drizzle (possibly related to #1?)![image](https://github.com/DallasHoff/sqlocal/assets/78506690/77e678b9-9841-4991-8f0a-a5e08edc1d85)
I have tried both
"moduleResolution": "bundler"
and"moduleResolution": "nodenext"
as well asI also tried the minimal hello world example from your other repo, however to compile it I had to remove
"noEmit": true
and"allowImportingTsExtensions": true
the problem persists :