Skip to content

Commit 9107dee

Browse files
authored
Merge branch 'canary' into eslint8
2 parents b745898 + ee3a510 commit 9107dee

File tree

46 files changed

+630
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+630
-155
lines changed

contributing.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,24 @@ There are two options to develop with your local version of the codebase:
164164
yarn install --force
165165
```
166166

167-
or
167+
#### Troubleshooting
168+
169+
- If you see the below error while running `yarn dev` with next:
170+
171+
```
172+
Failed to load SWC binary, see more info here: https://nextjs.org/docs/messages/failed-loading-swc
173+
```
174+
175+
Try to add the below section to your `package.json`, then run again
176+
177+
```json
178+
"optionalDependencies": {
179+
"@next/swc-linux-x64-gnu": "canary",
180+
"@next/swc-win32-x64-msvc": "canary",
181+
"@next/swc-darwin-x64": "canary",
182+
"@next/swc-darwin-arm64": "canary"
183+
},
184+
```
168185

169186
### Develop inside the monorepo
170187

docs/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ description: Learn how to set up Next.js with three commonly used testing tools
1313
</ul>
1414
</details>
1515

16-
Learn how to set up Next.js with three commonly used testing tools: [Cypress](https://www.cypress.io/blog/2021/04/06/cypress-component-testing-react/), [Jest](https://jestjs.io/docs/tutorial-react), and [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/).
16+
Learn how to set up Next.js with commonly used testing tools: [Cypress](https://nextjs.org/docs/testing#cypress), [Playwright](https://nextjs.org/docs/testing#playwright), and [Jest with React Testing Library](https://nextjs.org/docs/testing#jest-and-react-testing-library).
1717

1818
## Cypress
1919

examples/auth0/pages/advanced/ssr-profile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function getServerSideProps({ req, res }) {
2121
// Here you can check authentication status directly before rendering the page,
2222
// however the page would be a serverless function, which is more expensive and
2323
// slower than a static page with client side authentication
24-
const session = await auth0.getSession(req)
24+
const session = await auth0.getSession(req, res)
2525

2626
if (!session || !session.user) {
2727
res.writeHead(302, {

jest.config.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
const path = require('path')
1+
const nextJest = require('next/jest')
22

3-
module.exports = {
3+
const createJestConfig = nextJest()
4+
5+
// Any custom config you want to pass to Jest
6+
const customJestConfig = {
47
testMatch: ['**/*.test.js', '**/*.test.ts', '**/*.test.tsx'],
58
setupFilesAfterEnv: ['<rootDir>/jest-setup-after-env.ts'],
69
verbose: true,
710
rootDir: 'test',
811
modulePaths: ['<rootDir>/lib'],
9-
transformIgnorePatterns: ['/node_modules/', '/next[/\\\\]dist/', '/.next/'],
10-
transform: {
11-
'.+\\.(t|j)sx?$': [
12-
// this matches our SWC options used in https://github.com/vercel/next.js/blob/canary/packages/next/taskfile-swc.js
13-
path.join(__dirname, './packages/next/jest.js'),
14-
],
15-
},
12+
transformIgnorePatterns: ['/next[/\\\\]dist/'],
1613
}
14+
15+
// createJestConfig is exported in this way to ensure that next/jest can load the Next.js config which is async
16+
module.exports = createJestConfig(customJestConfig)

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
"registry": "https://registry.npmjs.org/"
1818
}
1919
},
20-
"version": "12.0.4-canary.4"
20+
"version": "12.0.4-canary.8"
2121
}

packages/create-next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-next-app",
3-
"version": "12.0.4-canary.4",
3+
"version": "12.0.4-canary.8",
44
"keywords": [
55
"react",
66
"next",

packages/eslint-config-next/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-next",
3-
"version": "12.0.4-canary.4",
3+
"version": "12.0.4-canary.8",
44
"description": "ESLint configuration used by NextJS.",
55
"main": "index.js",
66
"license": "MIT",
@@ -9,7 +9,7 @@
99
"directory": "packages/eslint-config-next"
1010
},
1111
"dependencies": {
12-
"@next/eslint-plugin-next": "12.0.4-canary.4",
12+
"@next/eslint-plugin-next": "12.0.4-canary.8",
1313
"@rushstack/eslint-patch": "^1.0.8",
1414
"@typescript-eslint/parser": "^5.0.0",
1515
"eslint-import-resolver-node": "^0.3.4",

packages/eslint-plugin-next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/eslint-plugin-next",
3-
"version": "12.0.4-canary.4",
3+
"version": "12.0.4-canary.8",
44
"description": "ESLint plugin for NextJS.",
55
"main": "lib/index.js",
66
"license": "MIT",

packages/next-bundle-analyzer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/bundle-analyzer",
3-
"version": "12.0.4-canary.4",
3+
"version": "12.0.4-canary.8",
44
"main": "index.js",
55
"license": "MIT",
66
"repository": {

packages/next-codemod/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@next/codemod",
3-
"version": "12.0.4-canary.4",
3+
"version": "12.0.4-canary.8",
44
"license": "MIT",
55
"dependencies": {
66
"chalk": "4.1.0",

0 commit comments

Comments
 (0)