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

bug: broken tRPC error with latest t3 app and Auth5/googleProvider #2027

Open
electroheadfx opened this issue Nov 21, 2024 · 1 comment
Open

Comments

@electroheadfx
Copy link

electroheadfx commented Nov 21, 2024

Provide environment information

"ct3aMetadata": {
"initVersion": "7.38.1"
},

Describe the bug

I install the t3-app with default based on this setup

What will your project be called?
rwai-auth-t3-latest-7.38.1

- Typescript    yes
- Tailwind      yes
- tRPC          yes
- NextAuth      yes
- ORM           Drizzle
- App router    No
- Database      Postgres
- init Git      No
- pnpm install  yes
- git setup     no
- alias         ~/

I do the change with googleProvider with the good postgres DB etc ...

When I pnpm run dev: I got error on trpc:

 GET /api/trpc/post.hello?batch=1&input=%7B%220%22%3A%7B%22json%22%3A%7B%22text%22%3A%22from%20tRPC%22%7D%7D%7D 500 in 30ms
 ⨯ Error: Failed to load external module next-auth: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '~/rwai-auth-t3-latest-7.38.1/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected][email protected]/node_modules/next/server' imported from /Volumes/T7/work/railwai/Dev/labs/rwai-auth-t3-latest-7.38.1/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected][email protected]/node_modules/next-auth/lib/env.js
Did you mean to import [email protected][email protected][email protected][email protected]/node_modules/next/server.js?
    at externalImport (/Volumes/T7/work/railwai/Dev/labs/rwai-auth-t3-latest-7.38.1/.next/server/chunks/[turbopack]_runtime.js:352:15)
    at async (

with in screen:
Loading tRPC query...

I can log In and log Out fine with google but trpc is broken

Reproduction repo

http

To reproduce

I setup for google provider so I do:

# Generated by create-t3-app.
AUTH_SECRET="xxxxxxxxx"

AUTH_GOOGLE_ID="xxxxxxx"
AUTH_GOOGLE_SECRET="xxxxxxxxx"

DATABASE_URL="postgresql://postgres:password@localhost:5432/app"
  • setup src/env.js
export const env = createEnv({
	server: {
		...
		AUTH_GOOGLE_ID: z.string(),
    	AUTH_GOOGLE_SECRET: z.string(),
    	...
	},
	runtimeEnv: {
		...
		AUTH_GOOGLE_ID: process.env.AUTH_GOOGLE_ID,
    	AUTH_GOOGLE_SECRET: process.env.AUTH_GOOGLE_SECRET,
    	...
	}
})
  • import GoogleProvider from "next-auth/providers/google";

export const authConfig = {
providers: [
GoogleProvider
}

Additional information

System:
OS: macOS 15.1.1
CPU: (16) arm64 Apple M3 Max
Memory: 15.26 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
pnpm: 9.12.2 - /opt/homebrew/bin/pnpm
bun: 1.1.8 - /opt/homebrew/bin/bun

@electroheadfx
Copy link
Author

Run fine with T3 version 7.37.0 (Auth 4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant