Skip to content

TypeError: Cannot set properties of undefined (setting 'exports') #600

Open
@aldanchenko

Description

@aldanchenko

Hello 👋

I'm trying to use sql.js in my vscode extension. But getting this error:

"TypeError: Cannot set properties of undefined (setting 'exports')
    at /Users/dan/Projects/sql-ext-vscode/dist/extension.js:292298:395
        at new Promise (<anonymous>)
            at initSqlJs (/Users/dan/Projects/sql-ext-vscode/dist/extension.js:292227:24)
                at ChatHistoryDatabaseManager.initialize (/Users/dan/Projects/sql-ext-vscode/dist/extension.js:291937:52)
                    at activate (/Users/dan/Projects/sql-ext-vscode/dist/extension.js:68:25)
                        at async B0.n (file:///Users/dan/Soft/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:114:4447)
                            at async B0.m (file:///Users/dan/Soft/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:114:4410)
                                at async B0.l (file:///Users/dan/Soft/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:114:3866)"

My source code is

const SQL = await initSqlJs();
      if (fs.existsSync(dbPath)) {
        const fileBuffer = fs.readFileSync(dbPath);
        this.db = new SQL.Database(fileBuffer);
      } else {
        this.db = new SQL.Database();
      }

Maybe I'm doing something wrong?

Thank you!

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy