Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'sql.js/module' #109

Closed
EarMaster opened this issue Jul 29, 2021 · 3 comments · Fixed by #111
Closed

Cannot find module 'sql.js/module' #109

EarMaster opened this issue Jul 29, 2021 · 3 comments · Fixed by #111
Labels
type: bug Something isn't working as intended or expected.

Comments

@EarMaster
Copy link

EarMaster commented Jul 29, 2021

description

I try to use trilogy in a TypeScript project I'm currently working on. As soon as I use import { connect } from 'trilogy' somewhere I am presented with the error below by tsc:

I planned on using sqlite3 as backend therefore I only used npm i sqlite3, but the error appears wether I am defining the client to be sqlite3 or sql.js. I also tried to npm i sql.js, but the error persists.

steps to reproduce

  1. Create a new project
  2. Run npm install typescript @types/node
  3. Run npm install trilogy sqlite3
  4. Create index.ts with the source code below
  5. Run npx tsc index.ts

source

import { connect } from 'trilogy'

const db = connect(':memory:')

error

node_modules/trilogy/dist/index.d.ts:4:23 - error TS2307: Cannot find module 'sql.js/module' or its corresponding type declarations.

4 import { SqlJs } from 'sql.js/module';

environment

I am using Windows 10 Pro 64 Bit, Node v14.15.3 and npm 6.14.9.

@EarMaster EarMaster added the type: bug Something isn't working as intended or expected. label Jul 29, 2021
@haltcase
Copy link
Owner

haltcase commented Aug 1, 2021

Yeah, confirmed this is an issue. I'm not sure what's changed since this code was originally put in, but it should be a relatively easy fix to adjust those imports.

A quick glance through the history of sql.js made it seem like that entry point hasn't been a thing for quite a while ¯\_(ツ)_/¯

haltcase added a commit that referenced this issue Aug 8, 2021
haltcase added a commit that referenced this issue Aug 8, 2021
@EarMaster
Copy link
Author

Thank you!

@haltcase
Copy link
Owner

haltcase commented Aug 8, 2021

Sure thing, this is released in v2.0.4, please give it a shot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working as intended or expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants