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

Sqlite3 not working in Sveltekit #3684

Closed

Comments

@lubiah
Copy link

lubiah commented Feb 2, 2022

Describe the bug

I recently updated my sveltekit and I've found out that when I import the sqlite module, it pops up an error.

Reproduction

git clone https://github.com/kudadam/kudadam.com
npm install
npm run dev

Logs

Cannot find module 'C:\Personal Files\kudadam.com\node_modules\sqlite3\package.json' imported from 'C:\Personal Files\kudadam.com\node_modules\node-pre-gyp\lib\pre-binding.js'
Error: Cannot find module 'C:\Personal Files\kudadam.com\node_modules\sqlite3\package.json' imported from 'C:\Personal Files\kudadam.com\node_modules\node-pre-gyp\lib\pre-binding.js'
    at viteResolve (C:\Personal Files\kudadam.com\node_modules\vite\dist\node\chunks\dep-aff09a4c.js:56147:25)
    at Function.<anonymous> (C:\Personal Files\kudadam.com\node_modules\vite\dist\node\chunks\dep-aff09a4c.js:56161:28)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.exports.find (C:\Personal Files\kudadam.com\node_modules\node-pre-gyp\lib\pre-binding.js:20:23)
    at Object.<anonymous> (C:\Personal Files\kudadam.com\node_modules\sqlite3\lib\sqlite3-binding.js:3:27)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
[svelte-preprocess] Deprecation notice: using the "type" attribute is no longer recommended and will be removed in the next major version. Please use the "lang" attribute instead.
500 Error: Cannot find module 'C:\Personal Files\kudadam.com\node_modules\sqlite3\package.json' imported from 'C:\Personal Files\kudadam.com\node_modules\node-pre-gyp\lib\pre-binding.js'
    at viteResolve (C:\Personal Files\kudadam.com\node_modules\vite\dist\node\chunks\dep-aff09a4c.js:56147:25)
    at Function.<anonymous> (C:\Personal Files\kudadam.com\node_modules\vite\dist\node\chunks\dep-aff09a4c.js:56161:28)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.exports.find (C:\Personal Files\kudadam.com\node_modules\node-pre-gyp\lib\pre-binding.js:20:23)
    at Object.<anonymous> (C:\Personal Files\kudadam.com\node_modules\sqlite3\lib\sqlite3-binding.js:3:27)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  code: 'ERR_MODULE_NOT_FOUND'
}

System Info

System:
    OS: Windows 8.1 6.3.9600
    CPU: (2) x64 Pentium(R) Dual-Core  CPU      E5300  @ 2.60GHz
    Memory: 1.32 GB / 3.90 GB
  Binaries:
    Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
    npm: 8.4.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Internet Explorer: 11.0.9600.17037
  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.17
    @sveltejs/kit: next => 1.0.0-next.256
    svelte: ^3.46.0 => 3.46.3

Severity

blocking all usage of SvelteKit

Additional Information

No response

@bluwy
Copy link
Member

bluwy commented Feb 2, 2022

Duplicate of #3118

@bluwy bluwy marked this as a duplicate of #3118 Feb 2, 2022
@bluwy bluwy closed this as completed Feb 2, 2022
@lubiah
Copy link
Author

lubiah commented Feb 2, 2022

@bluwy . I do not understand how you will do the package.json overriding, can you give a simple snippet of how to go about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment