withastro/astro

Error: The specified module could not be found - ERR_DLOPEN_FAILED when add Astro Db integration

Johnkat-Mj opened this issue · 2 comments

Astro Info

node:internal/modules/cjs/loader:1586
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The specified module could not be found.
\\?\C:\Users\johnk\Desktop\dev\tasks-manager\node_modules\@libsql\win32-x64-msvc\index.node
    at Module._extensions..node (node:internal/modules/cjs/loader:1586:18)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at requireNative (C:\Users\johnk\Desktop\dev\tasks-manager\node_modules\libsql\index.js:22:10)
    at Object.<anonymous> (C:\Users\johnk\Desktop\dev\tasks-manager\node_modules\libsql\index.js:45:5)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32) {
  code: 'ERR_DLOPEN_FAILED'
}

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I encountered an error while trying to run my Astro project. The error message indicates that a specified module could not be found.

node:internal/modules/cjs/loader:1586
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The specified module could not be found.
\\?\C:\Users\johnk\Desktop\dev\tasks-manager\node_modules\@libsql\win32-x64-msvc\index.node
    at Module._extensions..node (node:internal/modules/cjs/loader:1586:18)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at requireNative (C:\Users\johnk\Desktop\dev\tasks-manager\node_modules\libsql\index.js:22:10)
    at Object.<anonymous> (C:\Users\johnk\Desktop\dev\tasks-manager\node_modules\libsql\index.js:45:5)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32) {
  code: 'ERR_DLOPEN_FAILED'
}

Steps to Reproduce:

  • Create a new Astro project.
  • Install all dependencies.
  • Add the @astrojs/db integration.
  • Run npm run dev

Expected Result: The Astro development server should start without any errors, and the project should be accessible in the browser.

Actual Result: The server fails to start

Environment

  • NodeJS: v20.18.0
  • Operating system: Windows 11
  • Astro version: ^4.16.9
  • Astro Db : ^0.14.3

Additional Context

I've tried the following steps to resolve the issue, but the error persists:

  • Verified the file path and ensured the module exists.
  • Deleted node_modules and package-lock.json, then reinstalled dependencies.

Important Note: When I try to reproduce the same thing in StackBlitz, everything works as expected. I still do not understand why this is happening on my local device.

What's the expected result?

The Astro development server should start without any errors, and the project should be accessible in the browser

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-wggy3j

Participation

  • I am willing to submit a pull request for this issue.

This seems to be a libsql issue, related to your platform. Not sure if there's something we could do 😔

Thanks @ematipico , I've just noticed that this problem is related to LIBSQL on win11, I've just tried it on win10 and it works PERFECTLY WELL.