language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | vercel | next.js | 1f49400a32eebd8528e70c1142da01c7e7a989fb.json | Remove unnecessary catch (#13639)
This undoes https://github.com/vercel/next.js/pull/13138 as the rename is done. | packages/create-next-app/helpers/examples.ts | @@ -83,32 +83,18 @@ export function downloadAndExtractRepo(
)
}
-export async function downloadAndExtractExample(
+export function downloadAndExtractExample(
root: string,
name: string
): Promise<void> {
if (name === '__internal-testing-retry') {
throw new Error('This is an internal example for tes... | false |
Other | vercel | next.js | 3dc24bbd795bd51bdbd6ff05d2f95026e15ad715.json | Update waitUntilValid parameters (#13612)
Since the reload function was removed this parameter is no longer needed 💯 | packages/next/server/hot-reloader.ts | @@ -168,7 +168,11 @@ export default class HotReloader {
this.previewProps = previewProps
}
- async run(req: IncomingMessage, res: ServerResponse, parsedUrl: UrlObject) {
+ public async run(
+ req: IncomingMessage,
+ res: ServerResponse,
+ parsedUrl: UrlObject
+ ) {
// Usually CORS support is ... | false |
Other | vercel | next.js | 48c8440016b49bbabde02931dc4cac13c09984a4.json | Add .vercel to gitignore (#13595)
Also added `.now`, this should make sure that if the Vercel CLI is used inside the examples to deploy a project, the project folder is not added to the list of changes. | .gitignore | @@ -30,3 +30,7 @@ examples/**/out
examples/**/.env*.local
pr-stats.md
+
+# Vercel
+.vercel
+.now | false |
Other | vercel | next.js | f8f308d6dd6c23476383b2e8d6f80484c194cf6f.json | Fix examples using __NEXT_DATA__ (#13567)
This PR fixes https://github.com/vercel/next.js/issues/4883.
It introduces a new global variable (`window.__REHYDRATE_IDS`) only when necessary.
In the case of the `with-react-with-styles` example, rehydration isn't happening, so I removed the creation of the variable.
In ... | examples/with-aphrodite/pages/_document.js | @@ -1,42 +1,43 @@
-import Document, { Head, Main, NextScript } from 'next/document'
+import Document, { Html, Head, Main, NextScript } from 'next/document'
import { StyleSheetServer } from 'aphrodite'
-export default class MyDocument extends Document {
+class MyDocument extends Document {
static async getInitialP... | true |
Other | vercel | next.js | f8f308d6dd6c23476383b2e8d6f80484c194cf6f.json | Fix examples using __NEXT_DATA__ (#13567)
This PR fixes https://github.com/vercel/next.js/issues/4883.
It introduces a new global variable (`window.__REHYDRATE_IDS`) only when necessary.
In the case of the `with-react-with-styles` example, rehydration isn't happening, so I removed the creation of the variable.
In ... | examples/with-aphrodite/pages/index.js | @@ -1,10 +1,10 @@
import { StyleSheet, css } from 'aphrodite'
+// Rehydrate to ensure that the client doesn't duplicate styles
+// It has to execute before any code that defines styles
+// '__REHYDRATE_IDS' is set in '_document.js'
if (typeof window !== 'undefined') {
- /* StyleSheet.rehydrate takes an array of re... | true |
Other | vercel | next.js | f8f308d6dd6c23476383b2e8d6f80484c194cf6f.json | Fix examples using __NEXT_DATA__ (#13567)
This PR fixes https://github.com/vercel/next.js/issues/4883.
It introduces a new global variable (`window.__REHYDRATE_IDS`) only when necessary.
In the case of the `with-react-with-styles` example, rehydration isn't happening, so I removed the creation of the variable.
In ... | examples/with-glamor/pages/_document.js | @@ -1,32 +1,36 @@
-import Document, { Head, Main, NextScript } from 'next/document'
+import Document, { Html, Head, Main, NextScript } from 'next/document'
import { renderStatic } from 'glamor/server'
-export default class MyDocument extends Document {
+class MyDocument extends Document {
static async getInitialP... | true |
Other | vercel | next.js | f8f308d6dd6c23476383b2e8d6f80484c194cf6f.json | Fix examples using __NEXT_DATA__ (#13567)
This PR fixes https://github.com/vercel/next.js/issues/4883.
It introduces a new global variable (`window.__REHYDRATE_IDS`) only when necessary.
In the case of the `with-react-with-styles` example, rehydration isn't happening, so I removed the creation of the variable.
In ... | examples/with-glamor/pages/index.js | @@ -1,12 +1,17 @@
-import { rehydrate } from 'glamor'
+import { rehydrate, css } from 'glamor'
-// Adds server generated styles to glamor cache.
-// Has to run before any `style()` calls
-// '__NEXT_DATA__.ids' is set in '_document.js'
+// Rehydrate to ensure that the client doesn't duplicate styles
+// It has to exe... | true |
Other | vercel | next.js | f8f308d6dd6c23476383b2e8d6f80484c194cf6f.json | Fix examples using __NEXT_DATA__ (#13567)
This PR fixes https://github.com/vercel/next.js/issues/4883.
It introduces a new global variable (`window.__REHYDRATE_IDS`) only when necessary.
In the case of the `with-react-with-styles` example, rehydration isn't happening, so I removed the creation of the variable.
In ... | examples/with-react-intl/pages/_app.js | @@ -16,7 +16,7 @@ export default class MyApp extends App {
// Get the `locale` and `messages` from the request object on the server.
// In the browser, use the same values that the server serialized.
const { req } = ctx
- const { locale, messages } = req || window.__NEXT_DATA__.props
+ const { loca... | true |
Other | vercel | next.js | f8f308d6dd6c23476383b2e8d6f80484c194cf6f.json | Fix examples using __NEXT_DATA__ (#13567)
This PR fixes https://github.com/vercel/next.js/issues/4883.
It introduces a new global variable (`window.__REHYDRATE_IDS`) only when necessary.
In the case of the `with-react-with-styles` example, rehydration isn't happening, so I removed the creation of the variable.
In ... | examples/with-react-with-styles/pages/_document.js | @@ -1,42 +1,43 @@
-import Document, { Head, Main, NextScript } from 'next/document'
+import Document, { Html, Head, Main, NextScript } from 'next/document'
import { StyleSheetServer } from 'aphrodite'
-export default class MyDocument extends Document {
+class MyDocument extends Document {
static async getInitialP... | true |
Other | vercel | next.js | a32fa4243adae4f7ff79180e2d6db3d46a810485.json | Add ETag Support (#12802)
Closes #12045
This PR adds support for [etags](https://tools.ietf.org/html/rfc7232#section-3.2) to Next.js' API routes, which will improve user experience and decrease network traffic by enabling usage of etag-based caching. | packages/next/next-server/server/api-utils.ts | @@ -1,8 +1,10 @@
+import { IncomingMessage, ServerResponse } from 'http'
import { parse } from 'next/dist/compiled/content-type'
import { CookieSerializeOptions } from 'next/dist/compiled/cookie'
-import { IncomingMessage, ServerResponse } from 'http'
-import { PageConfig } from 'next/types'
+import generateETag from... | true |
Other | vercel | next.js | a32fa4243adae4f7ff79180e2d6db3d46a810485.json | Add ETag Support (#12802)
Closes #12045
This PR adds support for [etags](https://tools.ietf.org/html/rfc7232#section-3.2) to Next.js' API routes, which will improve user experience and decrease network traffic by enabling usage of etag-based caching. | test/integration/api-support/test/index.test.js | @@ -173,6 +173,17 @@ function runTests(dev = false) {
expect(data.status).toEqual(200)
})
+ it('should support etag spec', async () => {
+ const response = await fetchViaHTTP(appPort, '/api/blog')
+ const etag = response.headers.get('etag')
+
+ const unmodifiedResponse = await fetchViaHTTP(appPort, ... | true |
Other | vercel | next.js | 2a473ab42ca538337ad2ccb1e418d61e9a731c31.json | Make Linaria great again (#13568)
This PR fixes https://github.com/vercel/next.js/issues/7769.
However, I would like for @jayu to confirm that it's ok to use the latest Linaria 2.0 alpha release. I can confirm from my local testing that it's working as expected. | examples/with-linaria/package.json | @@ -7,8 +7,8 @@
"start": "next start"
},
"dependencies": {
- "@zeit/next-css": "1.0.1",
- "linaria": "1.2.4",
+ "@zeit/next-css": "^1.0.1",
+ "linaria": "2.0.0-alpha.5",
"next": "latest",
"react": "16.8.3",
"react-dom": "16.8.3" | false |
Other | vercel | next.js | ae3c38803999fa76a7f6814ef8fc7e56bce17ea7.json | Add support for rewriting non-fallback SSG pages (#11010)
Since non-fallback pages don't rely on the URL for hydration we can allow them to be rewritten to but pages with fallback still can't be rewritten to because we won't be able to parse the correct `/_next/data` path to request the page's data from. I added a tes... | packages/next/next-server/server/next-server.ts | @@ -580,6 +580,7 @@ export default class Server {
}
}
;(req as any)._nextDidRewrite = true
+ ;(req as any)._nextRewroteUrl = newUrl
return {
finished: false,
@@ -970,8 +971,12 @@ export default class Server {
isPreviewMode = previe... | true |
Other | vercel | next.js | ae3c38803999fa76a7f6814ef8fc7e56bce17ea7.json | Add support for rewriting non-fallback SSG pages (#11010)
Since non-fallback pages don't rely on the URL for hydration we can allow them to be rewritten to but pages with fallback still can't be rewritten to because we won't be able to parse the correct `/_next/data` path to request the page's data from. I added a tes... | test/integration/prerender/next.config.js | @@ -0,0 +1,12 @@
+module.exports = {
+ experimental: {
+ rewrites() {
+ return [
+ {
+ source: '/about',
+ destination: '/lang/en/about',
+ },
+ ]
+ },
+ },
+} | true |
Other | vercel | next.js | ae3c38803999fa76a7f6814ef8fc7e56bce17ea7.json | Add support for rewriting non-fallback SSG pages (#11010)
Since non-fallback pages don't rely on the URL for hydration we can allow them to be rewritten to but pages with fallback still can't be rewritten to because we won't be able to parse the correct `/_next/data` path to request the page's data from. I added a tes... | test/integration/prerender/pages/lang/[lang]/about.js | @@ -0,0 +1,12 @@
+export default ({ lang }) => <p>About: {lang}</p>
+
+export const getStaticProps = ({ params: { lang } }) => ({
+ props: {
+ lang,
+ },
+})
+
+export const getStaticPaths = () => ({
+ paths: ['en', 'es', 'fr', 'de'].map((p) => `/lang/${p}/about`),
+ fallback: false,
+}) | true |
Other | vercel | next.js | ae3c38803999fa76a7f6814ef8fc7e56bce17ea7.json | Add support for rewriting non-fallback SSG pages (#11010)
Since non-fallback pages don't rely on the URL for hydration we can allow them to be rewritten to but pages with fallback still can't be rewritten to because we won't be able to parse the correct `/_next/data` path to request the page's data from. I added a tes... | test/integration/prerender/test/index.test.js | @@ -36,6 +36,7 @@ let buildId
let distPagesDir
let exportDir
let stderr
+let origConfig
const startServer = async (optEnv = {}) => {
const scriptPath = join(appDir, 'server.js')
@@ -130,6 +131,26 @@ const expectedManifestRoutes = () => ({
initialRevalidateSeconds: false,
srcRoute: null,
},
+ '/la... | true |
Other | vercel | next.js | 4199de637678592fe2c06eb98662ae6a79449ce3.json | Remove old reloading code (#13554)
This code existed mostly to work around webpack 2 (yes 2.x) limitations where it crashed in certain cases where files didn't exist anymore. We have tests for that behavior and latest webpack has fixed these. Hence why this can be removed 👍 | packages/next/server/hot-reloader.ts | @@ -333,28 +333,6 @@ export default class HotReloader {
}
}
- async reload(): Promise<void> {
- this.stats = null
- this.serverStats = null
-
- await this.clean()
-
- const configs = await this.getWebpackConfig()
- const compiler = webpack(configs)
-
- const buildTools = await this.prepareB... | true |
Other | vercel | next.js | 4199de637678592fe2c06eb98662ae6a79449ce3.json | Remove old reloading code (#13554)
This code existed mostly to work around webpack 2 (yes 2.x) limitations where it crashed in certain cases where files didn't exist anymore. We have tests for that behavior and latest webpack has fixed these. Hence why this can be removed 👍 | packages/next/server/on-demand-entry-handler.ts | @@ -10,10 +10,7 @@ import { isWriteable } from '../build/is-writeable'
import * as Log from '../build/output/log'
import { ClientPagesLoaderOptions } from '../build/webpack/loaders/next-client-pages-loader'
import { API_ROUTE } from '../lib/constants'
-import {
- IS_BUNDLED_PAGE_REGEX,
- ROUTE_NAME_REGEX,
-} from ... | true |
Other | vercel | next.js | a7ae54d7cc7a21153a9c10f4f32a49de0d75382a.json | refactor(typescript): extract preflight functions (#13510)
This pull request refactors our TypeScript preflight check in preparation for dropping the `fork-ts-checker-webpack-plugin` plugin.
This will make reviewing the subsequent PR much easier.
---
There is no behavior change, so the existing test should cover th... | packages/next/lib/oxford-comma-list.ts | @@ -0,0 +1,14 @@
+export function getOxfordCommaList(items: string[]): string {
+ return items
+ .map(
+ (v, index, { length }) =>
+ (index > 0
+ ? index === length - 1
+ ? length > 2
+ ? ', and '
+ : ' and '
+ : ', '
+ : '') + v
+ )
+... | true |
Other | vercel | next.js | a7ae54d7cc7a21153a9c10f4f32a49de0d75382a.json | refactor(typescript): extract preflight functions (#13510)
This pull request refactors our TypeScript preflight check in preparation for dropping the `fork-ts-checker-webpack-plugin` plugin.
This will make reviewing the subsequent PR much easier.
---
There is no behavior change, so the existing test should cover th... | packages/next/lib/typescript/FatalTypeScriptError.ts | @@ -0,0 +1 @@
+export class FatalTypeScriptError extends Error {} | true |
Other | vercel | next.js | a7ae54d7cc7a21153a9c10f4f32a49de0d75382a.json | refactor(typescript): extract preflight functions (#13510)
This pull request refactors our TypeScript preflight check in preparation for dropping the `fork-ts-checker-webpack-plugin` plugin.
This will make reviewing the subsequent PR much easier.
---
There is no behavior change, so the existing test should cover th... | packages/next/lib/typescript/getTypeScriptConfiguration.ts | @@ -0,0 +1,59 @@
+import chalk from 'next/dist/compiled/chalk'
+import os from 'os'
+import path from 'path'
+import { FatalTypeScriptError } from './FatalTypeScriptError'
+
+export async function getTypeScriptConfiguration(
+ ts: typeof import('typescript'),
+ tsConfigPath: string
+): Promise<import('typescript').Pa... | true |
Other | vercel | next.js | a7ae54d7cc7a21153a9c10f4f32a49de0d75382a.json | refactor(typescript): extract preflight functions (#13510)
This pull request refactors our TypeScript preflight check in preparation for dropping the `fork-ts-checker-webpack-plugin` plugin.
This will make reviewing the subsequent PR much easier.
---
There is no behavior change, so the existing test should cover th... | packages/next/lib/typescript/getTypeScriptIntent.ts | @@ -0,0 +1,39 @@
+import { promises as fs } from 'fs'
+import path from 'path'
+import { fileExists } from '../file-exists'
+import { recursiveReadDir } from '../recursive-readdir'
+
+export type TypeScriptIntent = { firstTimeSetup: boolean }
+
+export async function getTypeScriptIntent(
+ baseDir: string,
+ pagesDir... | true |
Other | vercel | next.js | a7ae54d7cc7a21153a9c10f4f32a49de0d75382a.json | refactor(typescript): extract preflight functions (#13510)
This pull request refactors our TypeScript preflight check in preparation for dropping the `fork-ts-checker-webpack-plugin` plugin.
This will make reviewing the subsequent PR much easier.
---
There is no behavior change, so the existing test should cover th... | packages/next/lib/typescript/hasNecessaryDependencies.ts | @@ -0,0 +1,62 @@
+import chalk from 'next/dist/compiled/chalk'
+import path from 'path'
+import { fileExists } from '../file-exists'
+import { getOxfordCommaList } from '../oxford-comma-list'
+import { resolveRequest } from '../resolve-request'
+import { FatalTypeScriptError } from './FatalTypeScriptError'
+
+const req... | true |
Other | vercel | next.js | a7ae54d7cc7a21153a9c10f4f32a49de0d75382a.json | refactor(typescript): extract preflight functions (#13510)
This pull request refactors our TypeScript preflight check in preparation for dropping the `fork-ts-checker-webpack-plugin` plugin.
This will make reviewing the subsequent PR much easier.
---
There is no behavior change, so the existing test should cover th... | packages/next/lib/typescript/writeAppTypeDeclarations.ts | @@ -0,0 +1,19 @@
+import { promises as fs } from 'fs'
+import os from 'os'
+import path from 'path'
+import { fileExists } from '../file-exists'
+
+export async function writeAppTypeDeclarations(baseDir: string): Promise<void> {
+ // Reference `next` types
+ const appTypeDeclarations = path.join(baseDir, 'next-env.d.... | true |
Other | vercel | next.js | a7ae54d7cc7a21153a9c10f4f32a49de0d75382a.json | refactor(typescript): extract preflight functions (#13510)
This pull request refactors our TypeScript preflight check in preparation for dropping the `fork-ts-checker-webpack-plugin` plugin.
This will make reviewing the subsequent PR much easier.
---
There is no behavior change, so the existing test should cover th... | packages/next/lib/typescript/writeConfigurationDefaults.ts | @@ -0,0 +1,183 @@
+import { promises as fs } from 'fs'
+import chalk from 'next/dist/compiled/chalk'
+import * as CommentJson from 'next/dist/compiled/comment-json'
+import os from 'os'
+import { getTypeScriptConfiguration } from './getTypeScriptConfiguration'
+
+type DesiredCompilerOptionsShape = {
+ [key: string]:
+... | true |
Other | vercel | next.js | a7ae54d7cc7a21153a9c10f4f32a49de0d75382a.json | refactor(typescript): extract preflight functions (#13510)
This pull request refactors our TypeScript preflight check in preparation for dropping the `fork-ts-checker-webpack-plugin` plugin.
This will make reviewing the subsequent PR much easier.
---
There is no behavior change, so the existing test should cover th... | packages/next/lib/verifyTypeScriptSetup.ts | @@ -1,316 +1,46 @@
-import { promises as fsPromises } from 'fs'
-import chalk from 'next/dist/compiled/chalk'
-import * as CommentJson from 'next/dist/compiled/comment-json'
-import os from 'os'
import path from 'path'
-import { fileExists } from './file-exists'
-import { recursiveReadDir } from './recursive-readdir'
... | true |
Other | vercel | next.js | a7ae54d7cc7a21153a9c10f4f32a49de0d75382a.json | refactor(typescript): extract preflight functions (#13510)
This pull request refactors our TypeScript preflight check in preparation for dropping the `fork-ts-checker-webpack-plugin` plugin.
This will make reviewing the subsequent PR much easier.
---
There is no behavior change, so the existing test should cover th... | test/integration/tsconfig-verifier/test/index.test.js | @@ -44,13 +44,13 @@ describe('tsconfig.json verifier', () => {
\\"isolatedModules\\": true,
\\"jsx\\": \\"preserve\\"
},
- \\"exclude\\": [
- \\"node_modules\\"
- ],
\\"include\\": [
\\"next-env.d.ts\\",
\\"**/*.ts\\",
\\"**... | true |
Other | vercel | next.js | a7ae54d7cc7a21153a9c10f4f32a49de0d75382a.json | refactor(typescript): extract preflight functions (#13510)
This pull request refactors our TypeScript preflight check in preparation for dropping the `fork-ts-checker-webpack-plugin` plugin.
This will make reviewing the subsequent PR much easier.
---
There is no behavior change, so the existing test should cover th... | test/unit/oxford-comma.test.js | @@ -0,0 +1,36 @@
+/* eslint-env jest */
+import { getOxfordCommaList } from 'next/dist/lib/oxford-comma-list'
+
+describe('oxford-comma-list', () => {
+ test('empty array', () => {
+ expect(getOxfordCommaList([])).toMatchInlineSnapshot(`""`)
+ })
+
+ test('single item array', () => {
+ expect(getOxfordCommaLis... | true |
Other | vercel | next.js | a38c6cb3d9494ef7bbfd4874fb65135571a2d36e.json | Add err.sh link for threw undefined (#6649)
* Add err.sh link for threw undefined
* Update wording
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com> | errors/threw-undefined.md | @@ -0,0 +1,10 @@
+# Threw undefined in render
+
+#### Why This Error Occurred
+
+Somewhere in your code you `throw` an `undefined` value. Since this isn't a valid error there isn't a stack trace. We show this error instead to let you know what to look for.
+
+
+#### Possible Ways to Fix It
+
+Look in your pages and fin... | true |
Other | vercel | next.js | a38c6cb3d9494ef7bbfd4874fb65135571a2d36e.json | Add err.sh link for threw undefined (#6649)
* Add err.sh link for threw undefined
* Update wording
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com> | packages/next/server/next-dev-server.js | @@ -121,7 +121,9 @@ export default class DevServer extends Server {
}
if (!err && res.statusCode === 500) {
- err = new Error('An undefined error was thrown sometime during render...')
+ err = new Error('An undefined error was thrown sometime during render... ' +
+ 'See https://err.sh/zeit/n... | true |
Other | vercel | next.js | 1e4372c62763d92914dc1ef56f90c1329d035a82.json | Show a better error when someone throws undefined (#6646)
* Show a better error when someone throws undefined
* Update error wording
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Update error wording in test
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Update test an... | package.json | @@ -51,7 +51,8 @@
"packages/next/build/webpack/plugins/terser-webpack-plugin/**",
"examples/with-ioc/**",
"examples/with-kea/**",
- "examples/with-mobx/**"
+ "examples/with-mobx/**",
+ "test/integration/basic/pages/throw-undefined.js"
]
},
"devDependencies": { | true |
Other | vercel | next.js | 1e4372c62763d92914dc1ef56f90c1329d035a82.json | Show a better error when someone throws undefined (#6646)
* Show a better error when someone throws undefined
* Update error wording
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Update error wording in test
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Update test an... | packages/next-server/server/next-server.ts | @@ -307,7 +307,7 @@ export default class Server {
)
return html
} catch (err) {
- if (err.code === 'ENOENT') {
+ if (err && err.code === 'ENOENT') {
res.statusCode = 404
return this.renderErrorToHTML(null, req, res, pathname, query)
} else { | true |
Other | vercel | next.js | 1e4372c62763d92914dc1ef56f90c1329d035a82.json | Show a better error when someone throws undefined (#6646)
* Show a better error when someone throws undefined
* Update error wording
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Update error wording in test
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Update test an... | packages/next/server/next-dev-server.js | @@ -120,6 +120,10 @@ export default class DevServer extends Server {
return super.renderErrorToHTML(compilationErr, req, res, pathname, query)
}
+ if (!err && res.statusCode === 500) {
+ err = new Error('An undefined error was thrown sometime during render...')
+ }
+
try {
const out... | true |
Other | vercel | next.js | 1e4372c62763d92914dc1ef56f90c1329d035a82.json | Show a better error when someone throws undefined (#6646)
* Show a better error when someone throws undefined
* Update error wording
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Update error wording in test
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Update test an... | test/integration/basic/pages/throw-undefined.js | @@ -0,0 +1,11 @@
+function ThrowUndefined (props) {
+ return (
+ <div>throw-undefined</div>
+ )
+}
+
+ThrowUndefined.getInitialProps = () => {
+ throw undefined
+}
+
+export default ThrowUndefined
\ No newline at end of file | true |
Other | vercel | next.js | 1e4372c62763d92914dc1ef56f90c1329d035a82.json | Show a better error when someone throws undefined (#6646)
* Show a better error when someone throws undefined
* Update error wording
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Update error wording in test
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com>
* Update test an... | test/integration/basic/test/rendering.js | @@ -289,5 +289,10 @@ export default function ({ app }, suiteName, render, fetch) {
expect($('#asPath').text()).toBe('Current asPath: /nav/with-hoc')
})
})
+
+ it('should show a valid error when undefined is thrown', async () => {
+ const $ = await get$('/throw-undefined')
+ expect($('b... | true |
Other | vercel | next.js | 38ad8d870c6b358e0dda624e982eba7a9a00ddbe.json | Fix export with folders that contain dot (#6538) | packages/next/export/worker.js | @@ -38,7 +38,10 @@ process.on(
})
let htmlFilename = `${path}${sep}index.html`
- if (extname(path) !== '') {
+ const pageExt = extname(page)
+ const pathExt = extname(path)
+ // Make sure page isn't a folder with a dot in the name e.g. `v1.2`
+ if (pageExt !== path... | true |
Other | vercel | next.js | 38ad8d870c6b358e0dda624e982eba7a9a00ddbe.json | Fix export with folders that contain dot (#6538) | test/integration/export/next.config.js | @@ -23,6 +23,6 @@ module.exports = (phase) => {
'/file-name.md': { page: '/dynamic', query: { text: 'this file has an extension' } },
'/query': { page: '/query', query: { a: 'blue' } }
}
- }
+ } // end exportPathMap
}
} | true |
Other | vercel | next.js | 38ad8d870c6b358e0dda624e982eba7a9a00ddbe.json | Fix export with folders that contain dot (#6538) | test/integration/export/pages/v1.12/docs.js | @@ -0,0 +1,5 @@
+export default function Docs (props) {
+ return (
+ <div>Hello again 👋</div>
+ )
+} | true |
Other | vercel | next.js | 38ad8d870c6b358e0dda624e982eba7a9a00ddbe.json | Fix export with folders that contain dot (#6538) | test/integration/export/pages/v1.12/index.js | @@ -0,0 +1,5 @@
+export default function Index (props) {
+ return (
+ <div>Hello 👋</div>
+ )
+} | true |
Other | vercel | next.js | 38ad8d870c6b358e0dda624e982eba7a9a00ddbe.json | Fix export with folders that contain dot (#6538) | test/integration/export/test/index.test.js | @@ -9,7 +9,8 @@ import {
stopApp,
killApp,
findPort,
- renderViaHTTP
+ renderViaHTTP,
+ File
} from 'next-test-utils'
import ssr from './ssr'
@@ -26,8 +27,25 @@ const access = promisify(fs.access)
const appDir = join(__dirname, '../')
const context = {}
const devContext = {}
+const nextConfig = new F... | true |
Other | vercel | next.js | c685b9b0d0da246cbfb697bb32e02ee953fa762d.json | Apply workaround for Firefox bug (#6630)
* Apply workaround for Firefox bug
and shallow routing
* Update to only apply workaround when needed
* Add TODO for future removal
Co-Authored-By: ijjk <22380829+ijjk@users.noreply.github.com> | packages/next-server/lib/router/router.js | @@ -1,4 +1,4 @@
-/* global __NEXT_DATA__ */
+/* global __NEXT_DATA__, location */
import { parse } from 'url'
import mitt from '../mitt'
@@ -40,6 +40,16 @@ export default class Router {
this.changeState('replaceState', formatWithValidation({ pathname, query }), as)
window.addEventListener('popstate'... | false |
Other | vercel | next.js | e5636dcdb0dec241316dc1822c1cc6c456e11556.json | Inject the build ID after webpack runs (#6618)
* Inject the build ID after webpack runs
* add webpack sources types
* use webpack plugin instead
* reset file
* Skip source maps if none were provided
Co-Authored-By: Timer <timer150@gmail.com> | packages/next/build/entries.ts | @@ -41,7 +41,6 @@ export function createEntrypoints(pages: PagesMapping, target: 'server'|'serverl
absoluteDocumentPath: pages['/_document'],
absoluteErrorPath: pages['/_error'],
distDir: DOT_NEXT_ALIAS,
- buildId,
assetPrefix: config.assetPrefix,
generateEtags: config.generateEtags
} | true |
Other | vercel | next.js | e5636dcdb0dec241316dc1822c1cc6c456e11556.json | Inject the build ID after webpack runs (#6618)
* Inject the build ID after webpack runs
* add webpack sources types
* use webpack plugin instead
* reset file
* Skip source maps if none were provided
Co-Authored-By: Timer <timer150@gmail.com> | packages/next/build/webpack-config.ts | @@ -290,7 +290,7 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, isServe
return /next-server[\\/]dist[\\/]/.test(context) || /next[\\/]dist[\\/]/.test(context)
}
}),
- target === 'serverless' && isServer && new ServerlessPlugin(),
+ target === 'serverless... | true |
Other | vercel | next.js | e5636dcdb0dec241316dc1822c1cc6c456e11556.json | Inject the build ID after webpack runs (#6618)
* Inject the build ID after webpack runs
* add webpack sources types
* use webpack plugin instead
* reset file
* Skip source maps if none were provided
Co-Authored-By: Timer <timer150@gmail.com> | packages/next/build/webpack/loaders/next-serverless-loader.ts | @@ -10,7 +10,6 @@ export type ServerlessLoaderQuery = {
absoluteAppPath: string,
absoluteDocumentPath: string,
absoluteErrorPath: string,
- buildId: string,
assetPrefix: string,
generateEtags: string
}
@@ -20,7 +19,6 @@ const nextServerlessLoader: loader.Loader = function () {
distDir,
absolu... | true |
Other | vercel | next.js | e5636dcdb0dec241316dc1822c1cc6c456e11556.json | Inject the build ID after webpack runs (#6618)
* Inject the build ID after webpack runs
* add webpack sources types
* use webpack plugin instead
* reset file
* Skip source maps if none were provided
Co-Authored-By: Timer <timer150@gmail.com> | packages/next/build/webpack/plugins/serverless-plugin.ts | @@ -1,31 +1,96 @@
-import {Compiler} from 'webpack'
+import MagicString from 'magic-string'
+import { Compiler } from 'webpack'
+import { SourceMapSource, RawSource } from 'webpack-sources'
import GraphHelpers from 'webpack/lib/GraphHelpers'
+
/**
* Makes sure there are no dynamic chunks when the target is serverle... | true |
Other | vercel | next.js | e5636dcdb0dec241316dc1822c1cc6c456e11556.json | Inject the build ID after webpack runs (#6618)
* Inject the build ID after webpack runs
* add webpack sources types
* use webpack plugin instead
* reset file
* Skip source maps if none were provided
Co-Authored-By: Timer <timer150@gmail.com> | packages/next/package.json | @@ -65,6 +65,7 @@
"imurmurhash": "0.1.4",
"launch-editor": "2.2.1",
"loader-utils": "1.1.0",
+ "magic-string": "0.25.2",
"mkdirp": "0.5.1",
"nanoid": "1.2.1",
"next-server": "8.0.4-canary.10",
@@ -110,6 +111,7 @@
"@types/nanoid": "1.2.0",
"@types/node-fetch": "2.1.4",
"@t... | true |
Other | vercel | next.js | e5636dcdb0dec241316dc1822c1cc6c456e11556.json | Inject the build ID after webpack runs (#6618)
* Inject the build ID after webpack runs
* add webpack sources types
* use webpack plugin instead
* reset file
* Skip source maps if none were provided
Co-Authored-By: Timer <timer150@gmail.com> | yarn.lock | @@ -1663,6 +1663,11 @@
"@types/mime" "*"
"@types/node" "*"
+"@types/source-list-map@*":
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9"
+ integrity sha512-K5K+yml8LTo9bWJI/rECfIPrGgxdpeNbj+d53lwN4QjW1M... | true |
Other | vercel | next.js | e2944c0aca59c84ead1dd13ef12cdf9462dcdcd9.json | Fix loading showing before `pastDelay` (#6628) | packages/next-server/lib/dynamic.js | @@ -25,7 +25,8 @@ export default function dynamic (dynamicOptions, options) {
let loadableFn = Loadable
let loadableOptions = {
// A loading component is not required, so we default it
- loading: ({ error, isLoading }) => {
+ loading: ({ error, isLoading, pastDelay }) => {
+ if (!pastDelay) return... | true |
Other | vercel | next.js | e2944c0aca59c84ead1dd13ef12cdf9462dcdcd9.json | Fix loading showing before `pastDelay` (#6628) | test/integration/basic/test/dynamic.js | @@ -74,10 +74,10 @@ export default (context, render) => {
})
})
describe('ssr:false option', () => {
- it('should render loading on the server side', async () => {
+ it('should not render loading on the server side', async () => {
const $ = await get$('/dynamic/no-ssr')
expe... | true |
Other | vercel | next.js | e2944c0aca59c84ead1dd13ef12cdf9462dcdcd9.json | Fix loading showing before `pastDelay` (#6628) | test/integration/production/test/dynamic.js | @@ -30,9 +30,9 @@ export default (context, render) => {
})
})
describe('ssr:false option', () => {
- it('should render loading on the server side', async () => {
+ it('should not render loading on the server side', async () => {
const $ = await get$('/dynamic/no-ssr')
- expect... | true |
Other | vercel | next.js | 8cf6ef58f0b6d39d35e5e2aaa161bc0be6719468.json | Remove unused dev option from babel-loader (#6624) | packages/next/build/webpack-config.ts | @@ -18,7 +18,7 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, isServe
const defaultLoaders = {
babel: {
loader: 'next-babel-loader',
- options: { dev, isServer, cwd: dir }
+ options: { isServer, cwd: dir }
},
// Backwards compat
hotSelfAccept: { | true |
Other | vercel | next.js | 8cf6ef58f0b6d39d35e5e2aaa161bc0be6719468.json | Remove unused dev option from babel-loader (#6624) | packages/next/build/webpack/loaders/next-babel-loader.js | @@ -10,19 +10,17 @@ module.exports = babelLoader.custom(babel => {
return {
customOptions (opts) {
const custom = {
- isServer: opts.isServer,
- dev: opts.dev
+ isServer: opts.isServer
}
const loader = Object.assign({
cacheCompression: false,
cacheDire... | true |
Other | vercel | next.js | 2e32aa86301c098adc80dc44117ba395ff33494b.json | Ensure correct key order (#6616)
* Ensure correct key order
* Fix bug
* Format this document while we're at it | packages/next/build/webpack/plugins/build-manifest-plugin.js | @@ -1,76 +1,95 @@
import { RawSource } from 'webpack-sources'
-import { BUILD_MANIFEST, ROUTE_NAME_REGEX, IS_BUNDLED_PAGE_REGEX, CLIENT_STATIC_FILES_RUNTIME_MAIN } from 'next-server/constants'
+import {
+ BUILD_MANIFEST,
+ ROUTE_NAME_REGEX,
+ IS_BUNDLED_PAGE_REGEX,
+ CLIENT_STATIC_FILES_RUNTIME_MAIN
+} from 'next-... | false |
Other | vercel | next.js | 179d09e8e08be323eac115d6b86659793d1a479a.json | Remove cacheKeys in favor of simply a cacheKey (#6613) | packages/next/build/webpack/plugins/terser-webpack-plugin/src/TaskRunner.js | @@ -1,6 +1,5 @@
import { join } from 'path';
import minify from './minify';
-import murmur from 'imurmurhash';
import { promisify } from 'util';
import workerFarm from 'worker-farm';
import { writeFile, readFile } from 'fs';
@@ -67,7 +66,7 @@ export default class TaskRunner {
tasks.forEach((task, index) => {
... | true |
Other | vercel | next.js | 179d09e8e08be323eac115d6b86659793d1a479a.json | Remove cacheKeys in favor of simply a cacheKey (#6613) | packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js | @@ -180,13 +180,9 @@ export class TerserPlugin {
};
if (this.options.cache) {
- task.cacheKeys = {
- terser: '3.16.1',
- // eslint-disable-next-line global-require
- 'next-minifier': '1.2.2',
- 'next-minifier-options': ... | true |
Other | vercel | next.js | 995460d7dd616f987d5bf91d05fe4bcd46c48661.json | Replace md4 hashing with murmurhash (#6611) | packages/next/build/webpack/plugins/terser-webpack-plugin/src/TaskRunner.js | @@ -1,6 +1,6 @@
-import crypto from 'crypto';
import { join } from 'path';
import minify from './minify';
+import murmur from 'imurmurhash';
import { promisify } from 'util';
import workerFarm from 'worker-farm';
import { writeFile, readFile } from 'fs';
@@ -67,10 +67,7 @@ export default class TaskRunner {
ta... | true |
Other | vercel | next.js | 995460d7dd616f987d5bf91d05fe4bcd46c48661.json | Replace md4 hashing with murmurhash (#6611) | packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js | @@ -1,8 +1,7 @@
/* eslint-disable
no-param-reassign
*/
-import crypto from 'crypto';
-
+import murmur from 'imurmurhash';
import { SourceMapConsumer } from 'source-map';
import { SourceMapSource, RawSource } from 'webpack-sources';
import RequestShortener from 'webpack/lib/RequestShortener';
@@ -186,10 +185,7 @... | true |
Other | vercel | next.js | 995460d7dd616f987d5bf91d05fe4bcd46c48661.json | Replace md4 hashing with murmurhash (#6611) | packages/next/package.json | @@ -62,6 +62,7 @@
"find-up": "2.1.0",
"fresh": "0.5.2",
"hoist-non-react-statics": "3.2.0",
+ "imurmurhash": "0.1.4",
"launch-editor": "2.2.1",
"loader-utils": "1.1.0",
"mkdirp": "0.5.1", | true |
Other | vercel | next.js | 995460d7dd616f987d5bf91d05fe4bcd46c48661.json | Replace md4 hashing with murmurhash (#6611) | yarn.lock | @@ -6308,7 +6308,7 @@ import-local@^1.0.0:
pkg-dir "^2.0.0"
resolve-cwd "^2.0.0"
-imurmurhash@^0.1.4:
+imurmurhash@0.1.4, imurmurhash@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
integrity sha1-khi5srkoo... | true |
Other | vercel | next.js | 553fbf75e0647f5088120788513b46ecf4af1360.json | Add note about passing webpack to config (#6606) | packages/next/README.md | @@ -1575,7 +1575,8 @@ In order to extend our usage of `webpack`, you can define a function that extend
// next.config.js is not transformed by Babel. So you can only use javascript features supported by your version of Node.js.
module.exports = {
- webpack: (config, { buildId, dev, isServer, defaultLoaders }) => {... | false |
Other | vercel | next.js | 176b5466bbfe3b92a35dbf1f2b8255556ccc7da9.json | Remove stray comma (#6593)
* eliminate need for render() method
* remove stray | examples/with-react-jss/pages/_document.js | @@ -21,7 +21,7 @@ export default class JssDocument extends Document {
return {
...initialProps,
styles: <>
- {initialProps.styles},
+ {initialProps.styles}
<style id='server-side-styles'>
{registry.toString()}
</style> | false |
Other | vercel | next.js | 0bcfd33c38c64c6a38470764e613566a4cfea430.json | eliminate need for render() method (#6591)
This simplifies the example and reuses the existing `initialProps.styles` logic. | examples/with-react-jss/pages/_document.js | @@ -1,5 +1,5 @@
import React from 'react'
-import Document, { Head, Main, NextScript } from 'next/document'
+import Document from 'next/document'
import { SheetsRegistry, JssProvider, createGenerateId } from 'react-jss'
export default class JssDocument extends Document {
@@ -20,24 +20,12 @@ export default class Js... | false |
Other | vercel | next.js | e8095c0e2ebc4532cfebdabe26247d0963039112.json | Remove cjs file (#6590) | packages/next/build/webpack-config.ts | @@ -12,7 +12,7 @@ import { ReactLoadablePlugin } from './webpack/plugins/react-loadable-plugin'
import { SERVER_DIRECTORY, REACT_LOADABLE_MANIFEST, CLIENT_STATIC_FILES_RUNTIME_WEBPACK, CLIENT_STATIC_FILES_RUNTIME_MAIN } from 'next-server/constants'
import { NEXT_PROJECT_ROOT, NEXT_PROJECT_ROOT_NODE_MODULES, NEXT_PROJ... | true |
Other | vercel | next.js | e8095c0e2ebc4532cfebdabe26247d0963039112.json | Remove cjs file (#6590) | packages/next/build/webpack/plugins/terser-webpack-plugin/src/cjs.js | @@ -1,3 +0,0 @@
-const plugin = require('./index');
-
-module.exports = plugin.default; | true |
Other | vercel | next.js | e8095c0e2ebc4532cfebdabe26247d0963039112.json | Remove cjs file (#6590) | packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js | @@ -12,7 +12,7 @@ const warningRegex = /\[.+:([0-9]+),([0-9]+)\]/;
const JS_REGEX = /\.m?js$/
-class TerserPlugin {
+export class TerserPlugin {
constructor(options = {}) {
const {
terserOptions = {},
@@ -306,5 +306,3 @@ class TerserPlugin {
});
}
}
-
-export default TerserPlugin; | true |
Other | vercel | next.js | 41278a62f2c459ac6407a4fee8f1b974e385f5da.json | Remove _error page from blocked pages (#6579) | packages/next-server/lib/constants.js | @@ -10,8 +10,7 @@ export const CONFIG_FILE = 'next.config.js'
export const BUILD_ID_FILE = 'BUILD_ID'
export const BLOCKED_PAGES = [
'/_document',
- '/_app',
- '/_error'
+ '/_app'
]
export const CLIENT_STATIC_FILES_PATH = 'static'
export const CLIENT_STATIC_FILES_RUNTIME = 'runtime' | true |
Other | vercel | next.js | 41278a62f2c459ac6407a4fee8f1b974e385f5da.json | Remove _error page from blocked pages (#6579) | test/integration/production/test/index.test.js | @@ -132,7 +132,7 @@ describe('Production Usage', () => {
})
it('should block special pages', async () => {
- const urls = ['/_document', '/_error']
+ const urls = ['/_document', '/_app']
for (const url of urls) {
const html = await renderViaHTTP(appPort, url)
expect(html).... | true |
Other | vercel | next.js | 1930d7364deeb3bc745026f81e0c1688f5c2f250.json | fix unnatural spaces in README (#6572)
should use 2 spaces instead of 4 | packages/next/README.md | @@ -141,11 +141,7 @@ Every `import` you declare gets bundled and served with each page. That means pa
import cowsay from 'cowsay-browser'
function CowsayHi() {
- return (
- <pre>
- {cowsay.say({ text: 'hi there!' })}
- </pre>
- )
+ return <pre>{cowsay.say({ text: 'hi there!' })}</pre>
}
export def... | false |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | errors/cant-override-next-props.md | @@ -6,7 +6,7 @@ In your `pages/_app.js` you returned an object from `getInitialProps` that conta
#### Possible Ways to Fix It
-Look in your _app.js component's `getInitialProps` function and make sure neither of these property names are present in the object returned.
+Look in your _app.js component's `getInitial... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | errors/circular-structure.md | @@ -2,7 +2,7 @@
#### Why This Error Occurred
-`getInitialProps` is serialized to JSON using `JSON.stringify` and sent to the client side for hydrating the page.
+`getInitialProps` is serialized to JSON using `JSON.stringify` and sent to the client side for hydrating the page.
However, the result returned from ... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | errors/multi-tabs.md | @@ -8,6 +8,6 @@ More info here: https://tools.ietf.org/html/rfc6202#section-5.1
#### Possible Ways to Fix It
-- Don't have too many tabs open to the same Next.js site open in development in the same browser at the same time.
+- Don't have too many tabs open to the same Next.js site open in development in the same... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | errors/popstate-state-empty.md | @@ -2,12 +2,12 @@
#### Why This Error Occurred
-When using the browser back button the popstate event is triggered. Next.js sets
+When using the browser back button the popstate event is triggered. Next.js sets
`popstate` event triggered but `event.state` did not have `url` or `as`, causing a route change failur... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | errors/promise-in-next-config.md | @@ -6,7 +6,7 @@ The webpack function in `next.config.js` returned a promise which is not support
```js
module.exports = {
- webpack: async function(config) {
+ webpack: async function(config) {
return config
}
} | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/custom-server-actionhero/README.md | @@ -1,6 +1,6 @@
# Running Next.JS and React /inside/ of ActionHero
-This server will render dynamic next.js/react pages on some routes, and normal ActionHero API requests on others.
+This server will render dynamic next.js/react pages on some routes, and normal ActionHero API requests on others.<br>
This configur... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/custom-server-koa/README.md | @@ -50,10 +50,10 @@ The example shows a server that serves the component living in `pages/a.js` when
## Side note: Enabling gzip compression
-The most common Koa middleware for handling the gzip compression is [compress](https://github.com/koajs/compress), but unfortunately it is currently not compatible with Next... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/root-static-files/static/sitemap.xml | @@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
- <loc>http://www.example.com/foo.html</loc>
+ <loc>http://www.example.com/foo.html</loc>
</url>
</urlset> | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/using-with-router/README.md | @@ -40,6 +40,6 @@ now
## The idea behind the example
-Sometimes, we want to use the `router` inside component of our app without using the singleton `next/router` API.
+Sometimes, we want to use the `router` inside component of our app without using the singleton `next/router` API.
You can do that by creating ... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-algolia-react-instantsearch/README.md | @@ -45,5 +45,5 @@ now
## The idea behind the example
The goal of this example is to illustrate how you can use [Algolia React InstantSearch](https://community.algolia.com/react-instantsearch/) to perform
-your search with a Server-rendered application developed with Next.js. It also illustrates how you
-can keep i... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-cloud9/README.md | @@ -22,26 +22,26 @@ nvm use node
const { createServer } = require('http')
const { parse } = require('url')
const next = require('next')
-
+
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })
const handle = app.getRequestHandler()
-
+
app.prepare().then... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-context-api/README.md | @@ -41,7 +41,7 @@ now
## The idea behind the example*
-This example shows how to use react context api in our app.
+This example shows how to use react context api in our app.
It provides an example of using `pages/_app.js` to include include the context api provider and then shows how both the `pages/index.js... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-dotenv/README.md | @@ -41,7 +41,7 @@ now
## The idea behind the example
-This example shows how to inline env vars.
+This example shows how to inline env vars.
**Please note**:
| true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-env-from-next-config-js/README.md | @@ -46,13 +46,13 @@ More specifically, what that means, is that environmental variables are programm
returned to your react components (including `getInitialProps`) when the program is built with `next build`.
As the build process (`next build`) is proceeding, `next.config.js` is processed and passed in as a parame... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-firebase-authentication/README.md | @@ -48,4 +48,4 @@ now
```
## The idea behind the example
-The goal is to authenticate users with firebase and store their auth token in sessions. A logged in user will see their messages on page load and then be able to post new messages.
+The goal is to authenticate users with firebase and store their auth token ... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-firebase-hosting-and-typescript/firebase.json | @@ -8,7 +8,7 @@
"npm run build-functions",
"npm run build-app",
"npm run copy-deps",
- "npm run install-deps"
+ "npm run install-deps"
]
},
"hosting": { | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-mobx-state-tree-typescript/tslint.json | @@ -1,7 +1,7 @@
{
"extends": [
"tslint-config-standard",
- "tslint:latest",
+ "tslint:latest",
"tslint-react"
],
"rules": {
@@ -12,7 +12,7 @@
"no-console": false,
"no-object-literal-type-assertion": false,
"no-submodule-imports": [
- true,
+ true,
"next"
... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-next-css/style.css | @@ -4,13 +4,13 @@
}
/* Post-CSS */
-/*
+/*
:root {
--some-color: red;
}
.example {
color: var(--some-color);
-}
+}
*/ | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-next-less/README.md | @@ -41,5 +41,5 @@ now
## The idea behind the example
-This example demonstrates how to use the [next-less plugin](https://github.com/zeit/next-plugins/tree/master/packages/next-less).
+This example demonstrates how to use the [next-less plugin](https://github.com/zeit/next-plugins/tree/master/packages/next-l... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-react-ga/README.md | @@ -41,5 +41,5 @@ now
## The idea behind the example
-This example shows the most basic way to use [react-ga](https://github.com/react-ga/react-ga) using custom [App](https://github.com/zeit/next.js#custom-app)
+This example shows the most basic way to use [react-ga](https://github.com/react-ga/react-ga) using cu... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-react-with-styles/README.md | @@ -41,10 +41,10 @@ now
## The idea behind the example
-This example features how you use a different styling solution than [styled-jsx](https://github.com/zeit/styled-jsx) that also supports universal styles.
-That means we can serve the required styles for the first render within the HTML and then load the rest... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-redux-observable/README.md | @@ -67,13 +67,13 @@ the default export from
We transform the Observable we get from `ajax` into a Promise in order to await
its resolution. That resolution should be a action (since the epic returns
-Observables of actions). We immediately dispatch that action to the store.
+Observables of actions). We immediately... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-refnux/README.md | @@ -42,17 +42,17 @@ now
## The idea behind the example
-This example, just like `with-redux` and `with-mobx` examples, shows how to manage a global state in your web-application.
+This example, just like `with-redux` and `with-mobx` examples, shows how to manage a global state in your web-application.
In this ca... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | examples/with-sitemap-and-robots-express-server-typescript/tslint.json | @@ -1,7 +1,7 @@
{
"extends": [
"tslint-config-standard",
- "tslint:latest",
+ "tslint:latest",
"tslint-react"
],
"rules": {
@@ -12,7 +12,7 @@
"no-console": false,
"no-object-literal-type-assertion": false,
"no-submodule-imports": [
- true,
+ true,
"next"
... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | packages/next/build/webpack-config.ts | @@ -86,35 +86,35 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, isServe
if (notExternalModules.indexOf(request) !== -1) {
return callback()
}
-
+
resolve(request, { basedir: dir, preserveSymlinks: true }, (err, res) => {
if (err) {
... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | packages/next/types/webpack.d.ts | @@ -18,7 +18,7 @@
// Grgur Grisogono <https://github.com/grgur>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
-
+
/// <reference types="node" />
declare module 'webpack' {
@@ -1882,4 +1882,4 @@ declare module 'webpack' {
/** @deprecated u... | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | test/integration/basic/pages/dynamic/bundle.js | @@ -25,7 +25,7 @@ const HelloBundle = dynamic({
export default class Bundle extends React.Component {
static childContextTypes = {
- data: PropTypes.object
+ data: PropTypes.object
}
static getInitialProps ({ query }) { | true |
Other | vercel | next.js | d9060f5abd11086b63de5f5a32cc801e9aae3105.json | Remove trailing spaces (#6547)
### changes
#### remove trailing spaces
When I was using example I noticed trailing spaces.
So, this PR removes the trailing spaces of json file, README, and others.
`examples/with-jest-typescript/src/modules/cars/Overview.tsx` also has it, but this time it did not change as tsli... | test/integration/production/pages/dynamic/bundle.js | @@ -24,7 +24,7 @@ const HelloBundle = dynamic({
export default class Bundle extends React.Component {
static childContextTypes = {
- data: PropTypes.object
+ data: PropTypes.object
}
static getInitialProps ({ query }) { | true |
Other | vercel | next.js | e112df431996521ba52d4244ce6f6423931020b4.json | Throw error when router methods are used in SSR (#6550)
* Update to use the correct router instance in withRouter so error is
thrown when router method is used during SSR
* Revert changes to with-router and add error to methods on
direct router instance
* Extend Router and override methods with error instead
... | errors/no-router-instance.md | @@ -0,0 +1,9 @@
+# No Router Instance
+
+#### Why This Error Occurred
+
+During SSR you might have tried to access a router method `push`, `replace`, `back`, which is not supported.
+
+#### Possible Ways to Fix It
+
+Move any calls to router methods to `componentDidMount` or add a check such as `typeof window !== 'und... | true |
Other | vercel | next.js | e112df431996521ba52d4244ce6f6423931020b4.json | Throw error when router methods are used in SSR (#6550)
* Update to use the correct router instance in withRouter so error is
thrown when router method is used during SSR
* Revert changes to with-router and add error to methods on
direct router instance
* Extend Router and override methods with error instead
... | packages/next-server/server/render.tsx | @@ -20,6 +20,36 @@ type ComponentsEnhancer =
| { enhanceApp?: Enhancer; enhanceComponent?: Enhancer }
| Enhancer
+function noRouter() {
+ const message = 'No router instance found. you should only use "next/router" inside the client side of your app. https://err.sh/zeit/next.js/no-router-instance'
+ throw new... | true |
Other | vercel | next.js | e112df431996521ba52d4244ce6f6423931020b4.json | Throw error when router methods are used in SSR (#6550)
* Update to use the correct router instance in withRouter so error is
thrown when router method is used during SSR
* Revert changes to with-router and add error to methods on
direct router instance
* Extend Router and override methods with error instead
... | test/integration/with-router/pages/router-method-ssr.js | @@ -0,0 +1,8 @@
+import { withRouter } from 'next/router'
+
+function RouterMethodSSR ({ router }) {
+ if (typeof window === 'undefined') router.push('/a')
+ return <p>Navigating...</p>
+}
+
+export default withRouter(RouterMethodSSR) | true |
Other | vercel | next.js | e112df431996521ba52d4244ce6f6423931020b4.json | Throw error when router methods are used in SSR (#6550)
* Update to use the correct router instance in withRouter so error is
thrown when router method is used during SSR
* Revert changes to with-router and add error to methods on
direct router instance
* Extend Router and override methods with error instead
... | test/integration/with-router/test/index.test.js | @@ -2,7 +2,11 @@
/* global jasmine */
import { join } from 'path'
import {
+ getReactErrorOverlayContent,
nextServer,
+ launchApp,
+ findPort,
+ killApp,
nextBuild,
startApp,
stopApp
@@ -78,3 +82,22 @@ describe('withRouter', () => {
browser.close()
})
})
+
+describe('withRouter SSR', async (... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.