Open AyushKoul00 opened 1 year ago
Use PNPM to install the dependencies I used NPM ar first..but was not working. PNPM is also a packege manager like NPM
I used pnpm also. Getting same issue. I think it is because of the env variables. Do we have to provide all the env variables in order for this project to work?
[1] ā Invalid environment variables: {
[1] NEXTAUTH_SECRET: [ 'String must contain at least 1 character(s)' ],
[1] GITHUB_CLIENT_ID: [ 'String must contain at least 1 character(s)' ],
[1] GITHUB_CLIENT_SECRET: [ 'String must contain at least 1 character(s)' ],
[1] GITHUB_ACCESS_TOKEN: [ 'String must contain at least 1 character(s)' ],
[1] SMTP_FROM: [ 'String must contain at least 1 character(s)' ],
[1] POSTMARK_API_TOKEN: [ 'String must contain at least 1 character(s)' ],
[1] POSTMARK_SIGN_IN_TEMPLATE: [ 'String must contain at least 1 character(s)' ],
[1] POSTMARK_ACTIVATION_TEMPLATE: [ 'String must contain at least 1 character(s)' ],
[1] STRIPE_API_KEY: [ 'String must contain at least 1 character(s)' ],
[1] STRIPE_WEBHOOK_SECRET: [ 'String must contain at least 1 character(s)' ],
[1] STRIPE_PRO_MONTHLY_PLAN_ID: [ 'String must contain at least 1 character(s)' ]
[1] }
Taxonomy uses a library to validate env vars at start, you need to fill at least all the ones listed in the error message.
Yeah, need to provide all or remove some from env.mjs and from code accordingly
Getting the same error, Is there any fix?
Getting the same error, Is there any fix?
It's a user error š You need to provide the env variables.
where can I get them?
the same problem , where to get ?
Well, you need to register and set up all these services, or almost all of them (I didn't set up the build, I just put a plug in) Use your brain and AI to figure out these .env
jus create a .env and then create your environment
If you just want to get it running, without setting up these services, you can comment out the code in env.mjs
, then run pnpm dev
. Make sure to run pnpm install
first.
When I cloned the repo and ran
npm i
, it gave these issues:npm ERR! node_modules/@next-auth/prisma-adapter npm ERR! @next-auth/prisma-adapter@"^1.0.6" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! C:\Users\<USER>\AppData\Local\npm-cache\_logs\2023-05-28T15_20_21_673Z-eresolve-report.txt npm ERR! A complete log of this run can be found in: C:\Users\<USER>\AppData\Local\npm-cache\_logs\2023-05-28T15_20_21_673Z-debug-0.log
I then ran
npm i --legacy-peer-deps
which resolved the issues above but then when I runnpm run dev
I get these errors:[1] ready - started server on 0.0.0.0:3000, url: http://localhost:3000 [1] info - Loaded env from C:\DEV\Web\taxonomy\.env.local [0] Warning: Contentlayer might not work as expected on Windows [0] Contentlayer config change detected. Updating type definitions and data... [1] ā Invalid environment variables: { [1] NEXTAUTH_SECRET: [ 'String must contain at least 1 character(s)' ], [1] GITHUB_CLIENT_ID: [ 'String must contain at least 1 character(s)' ], [1] GITHUB_CLIENT_SECRET: [ 'String must contain at least 1 character(s)' ], [1] GITHUB_ACCESS_TOKEN: [ 'String must contain at least 1 character(s)' ], [1] SMTP_FROM: [ 'String must contain at least 1 character(s)' ], [1] POSTMARK_API_TOKEN: [ 'String must contain at least 1 character(s)' ], [1] POSTMARK_SIGN_IN_TEMPLATE: [ 'String must contain at least 1 character(s)' ], [1] POSTMARK_ACTIVATION_TEMPLATE: [ 'String must contain at least 1 character(s)' ], [1] STRIPE_API_KEY: [ 'String must contain at least 1 character(s)' ], [1] STRIPE_WEBHOOK_SECRET: [ 'String must contain at least 1 character(s)' ], [1] STRIPE_PRO_MONTHLY_PLAN_ID: [ 'String must contain at least 1 character(s)' ] [1] } [1] error - Failed to load next.config.mjs, see more info here https://nextjs.org/docs/messages/next-config-error [1] Error: Invalid environment variables [1] at f (file:///C:/DEV/Web/taxonomy/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:505) [1] at l (file:///C:/DEV/Web/taxonomy/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:695) [1] at C (file:///C:/DEV/Web/taxonomy/node_modules/@t3-oss/env-nextjs/dist/index.mjs:1:868) [1] at file:///C:/DEV/Web/taxonomy/env.mjs:4:20 [1] at ModuleJob.run (node:internal/modules/esm/module_job:193:25) [1] at async Promise.all (index 0) [1] at async ESMLoader.import (node:internal/modules/esm/loader:530:24) [1] at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15) [1] at async loadConfig (C:\DEV\Web\taxonomy\node_modules\next\dist\server\config.js:528:36) [1] at async NextServer.prepare (C:\DEV\Web\taxonomy\node_modules\next\dist\server\next.js:153:24) { [1] type: 'Error' [1] } [1] next dev exited with code 1 [0] Generated 15 documents in .contentlayer
U haven't setup envs it looks like
When I cloned the repo and ran
npm i
, it gave these issues:I then ran
npm i --legacy-peer-deps
which resolved the issues above but then when I runnpm run dev
I get these errors: