Skip to content

initSqlJs is not a function, require(sq-wasm.js) loads as Module in Electron #475

@jmw992

Description

@jmw992

I'm getting a "initSqlJs is not a function" error when I try to use the code example laid out in the github landing page for initiating a SQL instance. It does appear that that initSQL is getting loaded in as a module instead as a function. Clicking through the module proto functions I'm not seeing any initSQL or relevant functions unfortunately.

image

I have been able to get this to work if I add the module npm package and add the following to the top of the file, however that is causing some issues in my webpack bundler in my dev environment :(

import { createRequire } from 'module';
const require = createRequire(import.meta.url);

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