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

Development Instructions are incomplete/not working #145

Closed
kamtschatka opened this issue May 10, 2024 · 2 comments
Closed

Development Instructions are incomplete/not working #145

kamtschatka opened this issue May 10, 2024 · 2 comments

Comments

@kamtschatka
Copy link
Contributor

I tried to set up the workspace to see if I can contribute, but I am not able to get it to work.

  1. The setup page mentions cp .env.sample .env, but that does not exist. I have therefore created a .env file with DATA_DIR=<absolute path> inside.
  2. When I run everything, the login page loads fine, but when I then try to sign up, i get a "no such table: user" error. I checked the db.db file and it exists in the location of my DATA_DIR, but it is completely empty (0 bytes)
  3. I then tried to create some breakpoints in the db shared project to see if it even reaches there, but I am unable to stop at any of them for some reason. I am using VS Code and launched pnpm web with the debug config, but to no avail.

Would be great if you could provide more thorough instructions on setting up the dev environment.

@MohamedBassem
Copy link
Collaborator

Ah, I need to update the dev instructions, sorry for the hassle. Will update them over the weekend.

The error you're seeing indicates that you didn't run the migrations. Run pnpm run db:migrate from the root of the directory. One another missing instruction is that you need to symlink the .env file to the apps/web, apps/workers, and the packages/db directories so that the different components see the correct env.

@kamtschatka
Copy link
Contributor Author

Thanks, that allowed me to progress and create a user.
Then I got this exception:

https://next-auth.js.org/errors#jwt_session_error decryption operation failed {
  message: 'decryption operation failed',
  stack: 'JWEDecryptionFailed: decryption operation failed\n' +
    '    at gcmDecrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/runtime/decrypt.js:67:15)\n' +
    '    at decrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/runtime/decrypt.js:92:20)\n' +
    '    at flattenedDecrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js:143:52)\n' +
    '    at async compactDecrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js:18:23)\n' +
    '    at async jwtDecrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/jwt/decrypt.js:8:23)\n' +
    '    at async Object.decode (webpack-internal:///(rsc)/../../node_modules/next-auth/jwt/index.js:66:7)\n' +
    '    at async Object.session (webpack-internal:///(rsc)/../../node_modules/next-auth/core/routes/session.js:43:28)\n' +
    '    at async AuthHandler (webpack-internal:///(rsc)/../../node_modules/next-auth/core/index.js:165:27)\n' +
    '    at async getServerSession (webpack-internal:///(rsc)/../../node_modules/next-auth/next/index.js:159:19)\n' +
    '    at async Home (webpack-internal:///(rsc)/./app/page.tsx:10:21)',
  name: 'JWEDecryptionFailed'
}

I added NEXTAUTH_SECRET=<secret> to the .env and now it seems to work.

kamtschatka added a commit to kamtschatka/hoarder-app that referenced this issue May 10, 2024
updated the documentation on how to set up the development environment
kamtschatka added a commit to kamtschatka/hoarder-app that referenced this issue May 10, 2024
updated the documentation on how to set up the development environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants