-
Notifications
You must be signed in to change notification settings - Fork 18
example for Automattic/mongoose#15922 #10
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // app/layout.tsx | ||
| export const metadata = { | ||
| title: 'Your App', | ||
| description: '…', | ||
| }; | ||
| export default function RootLayout({ children, }) { | ||
| return (<html lang="en"><body>{children}</body> | ||
| </html>); | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||
| import mongoose from 'mongoose'; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This introduces Useful? React with 👍 / 👎. |
||||||
| import { revalidatePath } from 'next/cache'; | ||||||
| mongoose.connect('mongodb://127.0.0.1:27017/mongoose_test'); | ||||||
|
||||||
| mongoose.connect('mongodb://127.0.0.1:27017/mongoose_test'); | |
| await mongoose.connect('mongodb://127.0.0.1:27017/mongoose_test'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| /// <reference types="next" /> | ||
| /// <reference types="next/image-types/global" /> | ||
| /// <reference types="next/navigation-types/compat/navigation" /> | ||
| import "./.next/dev/types/routes.d.ts"; | ||
|
|
||
| // NOTE: This file should not be edited | ||
| // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,15 @@ | ||
| { | ||
| "dependencies": { | ||
| "@mongoosejs/studio": "^0.1.4", | ||
| "mongoose": "^9.0.0-0", | ||
| "next": "^16.0.2" | ||
| "@types/node": "^25.0.3", | ||
| "@types/react": "^19.2.7", | ||
| "@types/react-dom": "^19.2.3", | ||
| "mongoose": "^8.19.0", | ||
| "next": "^16.0.2", | ||
| "typescript": "^5.9.3" | ||
| }, | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "start": "next dev" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "ES2017", | ||
| "strict": true, | ||
| "skipLibCheck": true, | ||
| "moduleResolution": "bundler", | ||
| "isolatedModules": true, | ||
| "jsx": "react-jsx", | ||
| "lib": [ | ||
| "dom", | ||
| "dom.iterable", | ||
| "esnext" | ||
| ], | ||
| "allowJs": true, | ||
| "noEmit": true, | ||
| "incremental": true, | ||
| "module": "esnext", | ||
| "esModuleInterop": true, | ||
| "resolveJsonModule": true, | ||
| "plugins": [ | ||
| { | ||
| "name": "next" | ||
| } | ||
| ] | ||
| }, | ||
| "include": [ | ||
| "**/*.ts", | ||
| "**/*.tsx", | ||
| ".next/types/**/*.ts", | ||
| ".next/dev/types/**/*.ts" | ||
| ], | ||
| "exclude": [ | ||
| "node_modules" | ||
| ] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds a second
layoutfile (layout.jsx) in the sameappdirectory wherelayout.tsxalready exists. Next’s file-based routing expects exactly onelayoutper segment; having both extensions in the same folder results in a “duplicate layout” conflict or unpredictable file selection at build/dev time. Please remove the extra file or keep only one layout implementation.Useful? React with 👍 / 👎.