Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ const withMDX = createMDX();

/** @type {import('next').NextConfig} */
const config = {
basePath: '',
assetPrefix: process.env.NODE_ENV === 'production' ? '/docs' : '', // if serving under /docs path
assetPrefix: '/docs',
// Allow website (localhost:3001) to load assets when proxying docs
allowedDevOrigins: ['http://prisma.io'],
Comment on lines +8 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n apps/docs/next.config.mjs

Repository: prisma/web

Length of output: 2397


🌐 Web query:

Next.js allowedDevOrigins configuration option format expected values

💡 Result:

allowedDevOrigins is set in next.config.js/ts as an array of strings:

// next.config.js
module.exports = {
  allowedDevOrigins: ['local-origin.dev', '*.local-origin.dev'],
}

Expected values: each entry is a hostname (domain) or IP you want to allow in development, and you can use a leading wildcard for subdomains (e.g. *.example.com). The official docs show hostnames (not full URLs) as the intended format. [1]

In practice, if you’re trying to allow something like http://127.0.0.1:3000, you typically need to provide just 127.0.0.1 (i.e., omit the http:// and port). [2]

Sources: [1] Next.js docs, allowedDevOrigins option. [2] Next.js community thread discussing format pitfalls.


🏁 Script executed:

# Check for any environment-based logic in the file
head -30 apps/docs/next.config.mjs

Repository: prisma/web

Length of output: 873


The allowedDevOrigins format is incorrect and needs fixing.

The value 'http://prisma.io' includes the protocol scheme, but Next.js expects just the hostname. Change it to 'prisma.io' (without the http://). The comment mentioning localhost:3001 also seems misaligned with the actual value — clarify the intent: are you mapping prisma.io to localhost in your hosts file for the proxy setup, or should this be a different hostname?

Additionally, the assetPrefix: '/docs' is now unconditional — assets will be fetched from /docs/_next/... in all environments, including local dev. Ensure your dev setup (whether proxied or direct) properly handles this asset routing, otherwise you'll have broken assets when running locally.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/next.config.mjs` around lines 8 - 10, The allowedDevOrigins entry
is using a URL with scheme; change allowedDevOrigins to ['prisma.io'] (remove
'http://') and update the comment next to allowedDevOrigins to clarify whether
prisma.io is expected to be mapped to localhost via hosts file for proxying or
if another hostname should be used; also make assetPrefix conditional so it is
only '/docs' in non-development builds (e.g. use assetPrefix:
process.env.NODE_ENV === 'development' ? '' : '/docs' or honor an env var like
ASSET_PREFIX) so local dev does not break asset routing unless your proxy setup
explicitly serves assets under /docs.

reactStrictMode: true,
images: { unoptimized: true },
transpilePackages: ['@prisma-docs/eclipse'],
Expand Down
29 changes: 22 additions & 7 deletions apps/docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"compilerOptions": {
"baseUrl": ".",
"target": "ESNext",
"lib": [ "dom", "dom.iterable", "esnext" ],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand All @@ -16,10 +20,18 @@
"jsx": "react-jsx",
"incremental": true,
"paths": {
"@/*": ["./src/*"],
"@prisma-docs/ui/components/*": ["../../packages/ui/src/components/*"],
"@prisma-docs/ui/lib/*": ["../../packages/ui/src/lib/*"],
"fumadocs-mdx:collections/*": [".source/*"]
"@/*": [
"./src/*"
],
"@prisma-docs/ui/components/*": [
"../../packages/ui/src/components/*"
],
"@prisma-docs/ui/lib/*": [
"../../packages/ui/src/lib/*"
],
"fumadocs-mdx:collections/*": [
".source/*"
]
},
"plugins": [
{
Expand All @@ -32,7 +44,10 @@
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
".next/dev/types/**/*.ts",
".next/dev/dev/types/**/*.ts"
Comment on lines +47 to +48
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's read the tsconfig.json file to understand the context
cat -n apps/docs/tsconfig.json | head -60

Repository: prisma/web

Length of output: 1468


🏁 Script executed:

# Search for any references to .next/dev/dev in the codebase
rg '\.next/dev/dev' --type json --type ts --type js

Repository: prisma/web

Length of output: 111


🏁 Script executed:

# Also check for any .next/dev paths to understand the pattern
rg '\.next/dev' apps/docs/tsconfig.json

Repository: prisma/web

Length of output: 118


🏁 Script executed:

# Check if there are other tsconfig.json files in the monorepo with similar patterns
find . -name "tsconfig.json" -type f | head -20

Repository: prisma/web

Length of output: 211


🏁 Script executed:

# Search for any .next patterns in tsconfig files across the repo
rg '\.next/' -g 'tsconfig.json' -A 2 -B 2

Repository: prisma/web

Length of output: 922


🏁 Script executed:

# Check git history to see when this line was added and if there's context
git log --oneline -n 30 -- apps/docs/tsconfig.json 2>/dev/null || echo "Git history not available"

Repository: prisma/web

Length of output: 99


Remove the duplicate .next/dev/dev/types/**/*.ts path from the include array.

Line 48 contains a typo with a doubled dev segment. This pattern doesn't exist in the other Next.js app configs in the monorepo (apps/blog and apps/eclipse both use the standard .next/types/**/*.ts and .next/dev/types/**/*.ts). The extra line is dead config that won't match any actual Next.js-generated types, so it's safe to remove.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/docs/tsconfig.json` around lines 47 - 48, Remove the incorrect duplicate
path ".next/dev/dev/types/**/*.ts" from the tsconfig "include" array in
apps/docs/tsconfig.json; keep the correct Next.js type globs (e.g.,
".next/types/**/*.ts" and ".next/dev/types/**/*.ts") so the include entries
match the other apps and no dead config remains.

],
"exclude": [ "node_modules" ]
"exclude": [
"node_modules"
]
}
Loading