t3 app in turborepo now throws 404 error when accessing root

hello. I created a new t3 app instance in turborepo and after making a number of changes, just out of nowhere do I just get these random 404 errors. I tried to create a new t3 app as well as a new next app and copy the root layout and page files to isolate the issue, but I'm getting a 404 error. I also tried deleting the .next directory. The issue I'm getting is the one in the attachment. I was able to create a fresh app out of the turborepo monorepo and fix the issue that way, but I'd rather hang onto my commit history instead of practically nuking it by switching my turborepo into a non turborepo project. Thanks!
4 Replies
Lautaro_dapin
Lautaro_dapin16mo ago
you should show some files for people to help next.config.js package.json turbo.json [tprc].tsx utils/api.ts
alan
alan16mo ago
sure. my next.config.mjs
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
await import("./src/env.mjs");

/** @type {import("next").NextConfig} */
const config = {
reactStrictMode: true,

/**
* If you have `experimental: { appDir: true }` set, then you must comment the below `i18n` config
* out.
*
* @see https://github.com/vercel/next.js/issues/41980
*/
i18n: {
locales: ["en"],
defaultLocale: "en",
},
};
export default config;
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
await import("./src/env.mjs");

/** @type {import("next").NextConfig} */
const config = {
reactStrictMode: true,

/**
* If you have `experimental: { appDir: true }` set, then you must comment the below `i18n` config
* out.
*
* @see https://github.com/vercel/next.js/issues/41980
*/
i18n: {
locales: ["en"],
defaultLocale: "en",
},
};
export default config;
my package.json
{
"name": "web",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"postinstall": "prisma generate",
"lint": "next lint",
"start": "next start"
},
"dependencies": {
"@next-auth/prisma-adapter": "^1.0.5",
"@prisma/client": "^4.14.0",
"@t3-oss/env-nextjs": "^0.3.1",
"next": "^13.4.2",
"next-auth": "^4.22.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"zod": "^3.21.4"
},
"devDependencies": {
"@types/eslint": "^8.37.0",
"@types/node": "^18.16.0",
"@types/prettier": "^2.7.2",
"@types/react": "^18.2.6",
"@types/react-dom": "^18.2.4",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"autoprefixer": "^10.4.14",
"eslint": "^8.40.0",
"eslint-config-next": "^13.4.2",
"postcss": "^8.4.21",
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.2.8",
"prisma": "^4.14.0",
"tailwindcss": "^3.3.0",
"typescript": "^5.0.4"
},
"ct3aMetadata": {
"initVersion": "7.13.1"
}
}
{
"name": "web",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"postinstall": "prisma generate",
"lint": "next lint",
"start": "next start"
},
"dependencies": {
"@next-auth/prisma-adapter": "^1.0.5",
"@prisma/client": "^4.14.0",
"@t3-oss/env-nextjs": "^0.3.1",
"next": "^13.4.2",
"next-auth": "^4.22.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"zod": "^3.21.4"
},
"devDependencies": {
"@types/eslint": "^8.37.0",
"@types/node": "^18.16.0",
"@types/prettier": "^2.7.2",
"@types/react": "^18.2.6",
"@types/react-dom": "^18.2.4",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"autoprefixer": "^10.4.14",
"eslint": "^8.40.0",
"eslint-config-next": "^13.4.2",
"postcss": "^8.4.21",
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.2.8",
"prisma": "^4.14.0",
"tailwindcss": "^3.3.0",
"typescript": "^5.0.4"
},
"ct3aMetadata": {
"initVersion": "7.13.1"
}
}
my turbo.json
{
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
},
"lint": {
"outputs": []
},
"dev": {
"cache": false
}
}
}
{
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
},
"lint": {
"outputs": []
},
"dev": {
"cache": false
}
}
}
no trpc.tsx nor a utils/api.ts
Lautaro_dapin
Lautaro_dapin16mo ago
why are you on port 3002? you dont have any config to change the next default port
alan
alan16mo ago
I wanted to pin the port to 3002 since I was using the Discord Oauth and already committed to that port strangely, the problem just went away
Want results from more Discord servers?
Add your server