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

ERR_MODULE_NOT_FOUND in drizzle adapter #9844

Closed
xkalf opened this issue Jan 29, 2024 · 8 comments · Fixed by #9845 or #9870
Closed

ERR_MODULE_NOT_FOUND in drizzle adapter #9844

xkalf opened this issue Jan 29, 2024 · 8 comments · Fixed by #9845 or #9870
Labels
adapters Changes related to the core code concerning database adapters bug Something isn't working drizzle @auth/drizzle-adapter good first issue Good issue to take for first time contributors priority Priority fix or enhancement upstream The issue dervies from one of next-auth dependencies

Comments

@xkalf
Copy link

xkalf commented Jan 29, 2024

Adapter type

@auth/drizzle-adapter

Environment

System:
OS: Windows 11 10.0.22631
CPU: (24) x64 12th Gen Intel(R) Core(TM) i9-12900KF
Memory: 42.27 GB / 63.83 GB
Binaries:
Node: 18.18.2 - ~\scoop\apps\nvm\current\nodejs\nodejs\node.EXE
npm: 9.8.1 - ~\scoop\apps\nvm\current\nodejs\nodejs\npm.CMD
pnpm: 8.13.1 - ~\AppData\Local\pnpm\pnpm.CMD
bun: 1.0.21 - ~.bun\bin\bun.EXE
Browsers:
Edge: Chromium (121.0.2277.83)
Internet Explorer: 11.0.22621.1
npmPackages:
@auth/drizzle-adapter: ^0.4.0 => 0.4.0
next: ^14.0.4 => 14.1.0
next-auth: ^4.24.5 => 4.24.5
react: 18.2.0 => 18.2.0

Reproduction URL

https://github.com/xkalf/nomad_competition

Describe the issue

⨯ Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\hitech\code\nomad_competition\node_modules.pnpm@auth+drizzle-adapter@0.4.0\node_modules@auth\drizzle-adapter\lib\utils' imported from C:\Users
\hitech\code\nomad_competition\node_modules.pnpm@auth+drizzle-adapter@0.4.0\node_modules@auth\drizzle-adapter\lib\pg.js
at new NodeError (node:internal/errors:405:5)
at finalizeResolution (node:internal/modules/esm/resolve:327:11)
at moduleResolve (node:internal/modules/esm/resolve:946:10)
at defaultResolve (node:internal/modules/esm/resolve:1132:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap. (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36) {
code: 'ERR_MODULE_NOT_FOUND'
}

How to reproduce

pnpm dev and go to the localhost:3000 in server console is getting error calling db request is also not woking for this bug

Expected behavior

i just want work well without the error

@xkalf xkalf added adapters Changes related to the core code concerning database adapters bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Jan 29, 2024
balazsorban44 added a commit that referenced this issue Jan 29, 2024
balazsorban44 added a commit that referenced this issue Jan 29, 2024
* fix: append `.js` to import

Fixes #9844

* Update sqlite.ts
@balazsorban44 balazsorban44 reopened this Jan 29, 2024
@balazsorban44
Copy link
Member

Fixed the imports, but tests failed which is blocking release: https://github.com/nextauthjs/next-auth/actions/runs/7690823696/job/20955193600

Will need to look at it when I wake up. If somebody finds the fix before me, feel free to PR. Apologies!

@balazsorban44 balazsorban44 added good first issue Good issue to take for first time contributors drizzle @auth/drizzle-adapter and removed triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Jan 29, 2024
Copy link

This issue was marked with the good first issue label by a maintainer.

This means that it is a good candidate for someone interested in contributing to the project, but does not know where to start.

Have a look at the Contributing Guide first.

This will help you set up your development environment to get started. When you are ready, open a PR, and link back to this issue in the form of adding Fixes #1234 to the PR description, where 1234 is the issue number. This will auto-close the issue when the PR gets merged, making it easier for us to keep track of what has been fixed.

Please make sure that - if applicable - you add tests for the changes you make.

If you have any questions, feel free to ask in the comments below or the PR. Generally, you don't need to @mention anyone directly, as we will get notified anyway and will respond as soon as we can)

Note

There is no need to ask for permission "can I work on this?" Please, go ahead if there is no linked PR 🙂

@balazsorban44 balazsorban44 added the priority Priority fix or enhancement label Jan 29, 2024
@jadiaheno

This comment was marked as off-topic.

@xkalf

This comment was marked as off-topic.

@LukaHietala

This comment was marked as off-topic.

@jeroenpelgrims

This comment was marked as off-topic.

@balazsorban44
Copy link
Member

balazsorban44 commented Jan 30, 2024

Please don't spam the comments with "same issue".

The issue was the missing .js in the imports. The question is only why tests are failing https://github.com/nextauthjs/next-auth/actions/runs/7710641249/job/21014387531#step:8:70

@balazsorban44
Copy link
Member

balazsorban44 commented Feb 1, 2024

The failing test was caused by an upstream bug in Drizzle. See the explanation here: #9870 (comment)

Should be fixed now, please upgrade to at least @auth/drizzle-adapter@0.5.0!

balazsorban44 added a commit that referenced this issue Feb 3, 2024
Some examples where this caused a bug: #9883, #9844
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adapters Changes related to the core code concerning database adapters bug Something isn't working drizzle @auth/drizzle-adapter good first issue Good issue to take for first time contributors priority Priority fix or enhancement upstream The issue dervies from one of next-auth dependencies
Projects
None yet
5 participants