Skip to content

Regression problem? "self" #3

@mandolyte

Description

@mandolyte

EDIT 1: my worker example worked fine. scratching head
EDIT 2: all my other examples work ok, even the OPFS examples. So not sure why the in-memory, main thread example is having a problem.

I recall seeing this before. See https://sqlite.org/forum/forumpost/7937adc1e2035b41dc66b46bdf945b1de39d19d8ccba6fd2c18ad4580914adff

Before and after lines:

// import sqlite3InitModule from "./sqlite3-bundler-friendly.mjs";
import sqlite3InitModule from '@sqlite.org/sqlite-wasm';

This is the only change I made. This particular example uses the main thread without a worker. I have other examples that I can test as well (including OPFS support)

I am seeing this error:

error - ReferenceError: self is not defined
    at file:///home/cecil/Projects/github.com/mandolyte/sqlitenext/in-mem-main-thread/node_modules/@sqlite.org/sqlite-wasm/sqlite-wasm/jswasm/sqlite3-bundler-friendly.mjs:13192:27
    at file:///home/cecil/Projects/github.com/mandolyte/sqlitenext/in-mem-main-thread/node_modules/@sqlite.org/sqlite-wasm/sqlite-wasm/jswasm/sqlite3-bundler-friendly.mjs:13261:3
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15) {
  page: '/'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions