-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into styled-jsx-lib
- Loading branch information
Showing
117 changed files
with
973 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Failed to fetch devPagesManifest | ||
|
||
#### Why This Error Occurred | ||
|
||
The network request to load `_devPagesManifest.json` did not succeed. | ||
|
||
The dev pages manifest file is used by `next/link` to retrieve the list of pages to be (pre-)loaded by Next.js. | ||
If it fails, Next.js cannot properly navigate and link between pages. | ||
|
||
#### Possible Ways to Fix It | ||
|
||
- Make sure your browser developer tools, extensions, and any other network tools aren't blocking that request. | ||
- If you're running your Next.js application through a proxy, nginx, or other network layer, make sure links like `/_next/*` are configured to be allowed. | ||
|
||
### Useful Links | ||
|
||
- [Original GitHub Issue Thread](https://github.com/vercel/next.js/issues/16874) | ||
- [GitHub Issue Thread With Reproduction](https://github.com/vercel/next.js/issues/38047) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Removed parsed User Agent from Middleware API | ||
|
||
#### Why This Error Occurred | ||
|
||
Your application is interacting with `req.ua` which has been deprecated. | ||
|
||
```ts | ||
// middleware.ts | ||
import { NextRequest, NextResponse } from 'next/server' | ||
|
||
export function middleware(request: NextRequest) { | ||
const viewport = request.ua.device.type === 'mobile' ? 'mobile' : 'desktop' | ||
|
||
request.nextUrl.searchParams.set('viewport', viewport) | ||
return NextResponse.rewrites(request.nextUrl) | ||
} | ||
``` | ||
|
||
#### Possible Ways to Fix It | ||
|
||
The internal logic has been moved into a separate `userAgent` function that you can import from `next/server` and wrap your request instead. | ||
|
||
```ts | ||
// middleware.ts | ||
import { NextRequest, NextResponse, userAgent } from 'next/server' | ||
|
||
export function middleware(request: NextRequest) { | ||
const { device } = userAgent(request) | ||
const viewport = device.type === 'mobile' ? 'mobile' : 'desktop' | ||
|
||
request.nextUrl.searchParams.set('viewport', viewport) | ||
return NextResponse.rewrites(request.nextUrl) | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...les/with-static-export/components/post.js → ...es/with-static-export/components/post.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { PostData } from '../types/postdata' | ||
|
||
export async function GetPost(id: string): Promise<PostData> { | ||
const response = await fetch( | ||
`https://jsonplaceholder.typicode.com/posts/${id}` | ||
) | ||
const postData: PostData = (await response.json()) as PostData | ||
return postData | ||
} | ||
|
||
export async function GetPosts(): Promise<PostData[]> { | ||
const response = await fetch( | ||
'https://jsonplaceholder.typicode.com/posts?_page=1' | ||
) | ||
const postList: PostData[] = (await response.json()) as PostData[] | ||
return postList | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
{ | ||
"private": true, | ||
"dependencies": { | ||
"next": "latest", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"serve": "11.2.0" | ||
}, | ||
"scripts": { | ||
"dev": "next", | ||
"build": "next build", | ||
"preexport": "npm run build", | ||
"export": "next export", | ||
"prestart": "npm run export", | ||
"start": "serve out" | ||
"start": "serve out", | ||
"lint": "next lint" | ||
}, | ||
"dependencies": { | ||
"next": "latest", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"serve": "^14.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.0.0", | ||
"@types/react": "^18.0.14", | ||
"@types/react-dom": "^18.0.5", | ||
"eslint": "8.19.0", | ||
"eslint-config-next": "12.2.0", | ||
"typescript": "^4.7.4" | ||
} | ||
} |
Oops, something went wrong.