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

@auth/sequelize-adapter - Cannot find module #7826

Closed
Pab450 opened this issue Jun 18, 2023 · 7 comments
Closed

@auth/sequelize-adapter - Cannot find module #7826

Pab450 opened this issue Jun 18, 2023 · 7 comments
Labels
adapters Changes related to the core code concerning database adapters incomplete Insufficient reproduction. Without more info, we won't take further actions/provide help. sequelize @auth/sequelize-adapter triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@Pab450
Copy link

Pab450 commented Jun 18, 2023

Adapter type

@auth/sequelize-adapter

Environment

System:
OS: macOS 12.6
CPU: (10) arm64 Apple M1 Pro
Memory: 311.17 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 20.3.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 9.6.7 - /opt/homebrew/bin/npm
Browsers:
Chrome: 114.0.5735.133
Safari: 16.0

Reproduction URL

Client project. Using SvelteKit.

Update: https://github.com/Pab450/issue-sequelize-adapter

Describe the issue

when you run the "npm run dev" command and go to the project web page, the console returns :

[vite] Error when evaluating SSR module /src/hooks.server.js: failed to import "@auth/sequelize-adapter"

[ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/pablo/Documents/app/node_modules/@auth/sequelize-adapter/models' imported from /Users/pablo/Documents/app/node_modules/@auth/sequelize-adapter/index.js

when you run the "npm run build" command :

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/pablo/Documents/app/node_modules/@auth/sequelize-adapter/models' imported from /Users/pablo/Documents/app/node_modules/@auth/sequelize-adapter/index.js

How to reproduce

npm create svelte@latest my-app

Which Svelte app template?
│ ● Skeleton project
Add type checking with TypeScript?
│ ● No
Select additional option:
│ ● Prettier

cd my-app

npm i

npm i @auth/sequelize-adapter

create file src/hooks.server.js

add this line : import SequelizeAdapter from '@auth/sequelize-adapter'

save

npm run dev

go to web page indicate by sveltekit

look the error in console

npm run build

look the error in console

Expected behavior

no error...

to fix it go to ./node_modules/@auth/sequelize-adapter/index.js

change first line :

import * as defaultModels from "./models";

to

import * as defaultModels from "./models.js";

the error disappears

@Pab450 Pab450 added adapters Changes related to the core code concerning database adapters triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Jun 18, 2023
@github-actions github-actions bot added the sequelize @auth/sequelize-adapter label Jun 18, 2023
@pranatk

This comment was marked as off-topic.

@balazsorban44
Copy link
Member

You can verify that the required files are present: https://www.npmjs.com/package/@auth/sequelize-adapter?activeTab=code

Cannot tell more without a reproduction.

@balazsorban44 balazsorban44 added the incomplete Insufficient reproduction. Without more info, we won't take further actions/provide help. label Jun 20, 2023
@github-actions
Copy link

We cannot recreate the issue with the provided information. Please add a reproduction in order for us to be able to investigate.

Why was this issue marked with the incomplete label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository (template), but you can also use a tool like CodeSandbox or StackBlitz.

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue.

Please test your reproduction against the latest version of NextAuth.js (next-auth@latest) to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

What happens if I don't provide a sufficient minimal reproduction?

Issues with the incomplete label that receives no meaningful activity (e.g. new comments with a reproduction link) are closed after 7 days.

If your issue has not been resolved in that time and it has been closed/locked, please open a new issue with the required reproduction. (It's less likely that we check back on already closed issues.)

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps. Furthermore, you can upvote the issue using the 👍 reaction on the topmost comment (please do not comment "I have the same issue" without repro steps). Then, we can sort issues by votes to prioritize.

I think my reproduction is good enough, why aren't you looking into it quicker?

We look into every NextAuth.js issue and constantly monitor open issues for new comments.

However, sometimes we might miss one or two. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources

@Pab450
Copy link
Author

Pab450 commented Jun 20, 2023

You can verify that the required files are present: https://www.npmjs.com/package/@auth/sequelize-adapter?activeTab=code

Cannot tell more without a reproduction.

I don't understand what's non-reproducible about importing the package into a .js file and seeing the error displayed in the console!

but since that's the way it is, here's a repository where you can hopefully reproduce the error:

issue-sequelize-adapter

@pranatk can you try to clone the repo and try on your side to see if you still have the error?

@EggerickxGillian
Copy link

Hello,

I do have the same error while trying to run it. I have reproduced the same steps but still get the same error.

@Pab450 Pab450 changed the title @auth/sequelize-adapter - SvelteKit - Cannot find module @auth/sequelize-adapter - Cannot find module Jun 20, 2023
@balazsorban44
Copy link
Member

balazsorban44 commented Jun 21, 2023

thanks @Pab450. please always assume that a reproduction is needed, no matter how "trivial" an issue might be. it will accelerate the resolving of any potential issue, as well as contributing to a healthy open source community where we mutually help each other 💚.

Your repro was awesome!

This should be fixed now, please upgrade the package! 🙏

@Pab450
Copy link
Author

Pab450 commented Jun 21, 2023

I'm glad to hear that my reproduction was helpful in resolving the issue. I appreciate your efforts in addressing it promptly. Please let me know if there's anything else I can do to assist or contribute to the project. Thank you for all your hard work!

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 incomplete Insufficient reproduction. Without more info, we won't take further actions/provide help. sequelize @auth/sequelize-adapter triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

4 participants