solid-start
solid-start copied to clipboard
Cannot start applications using sqlite3
Hi, First of all I really enjoyed testing solid-start! thanks for the hard work.
I was unable to build & start an application that is using sqlite3, nor better-sqlite3, and think it might affect other packages build with node-gyp maybe.
How to reproduce:
- Take any example (I used typescript and SSR in my examples)
-
pnpm add sqlite3 - add in the index.tsx file:
import sqlite3 from 'sqlite3'; const db = new sqlite3.Database(':memory:'); -
pnpm build-> weird warning such as "'mock-aws-s3' is imported by mock-aws-s3?commonjs-external, " and "Circular dependency:" -
pnpm start-> error 'mock-aws-s3' not found
With better-sqlite3 (and yarn because pnpm does not want to add it in my WSL)
- Take any example
-
yarn add better-sqlite3 - add in the index.tsx file:
import Database from 'better-sqlite3'; const db = new Database('foobar.db', {}); -
yarn build-> no warning -
yarn start-> error:
if (fileName !== __filename) {
^
ReferenceError: __filename is not defined in ES module scope