Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
8e1046d9
Commit
8e1046d9
authored
Dec 18, 2019
by
Lachlan Campbell
Committed by
Joe Haddad
Dec 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error message typo: "Keys that need moved" (#9772)
parent
ac9f1665
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
utils.ts
packages/next/build/utils.ts
+1
-1
render.tsx
packages/next/next-server/server/render.tsx
+1
-1
index.test.js
test/integration/prerender-invalid-paths/test/index.test.js
+1
-1
No files found.
packages/next/build/utils.ts
View file @
8e1046d9
...
@@ -472,7 +472,7 @@ export async function isPageStatic(
...
@@ -472,7 +472,7 @@ export async function isPageStatic(
`\n\n\treturn { params: {
${
_validParamKeys
`\n\n\treturn { params: {
${
_validParamKeys
.
map
(
k
=>
`
${
k
}
: ...`
)
.
map
(
k
=>
`
${
k
}
: ...`
)
.
join
(
', '
)}
} }`
+
.
join
(
', '
)}
} }`
+
`\n\nKeys that need moved:
${
invalidKeys
.
join
(
', '
)}
.\n`
`\n\nKeys that need
to be
moved:
${
invalidKeys
.
join
(
', '
)}
.\n`
)
)
}
}
...
...
packages/next/next-server/server/render.tsx
View file @
8e1046d9
...
@@ -433,7 +433,7 @@ export async function renderToHTML(
...
@@ -433,7 +433,7 @@ export async function renderToHTML(
throw
new
Error
(
throw
new
Error
(
`Additional keys were returned from \`getStaticProps\`. Properties intended for your component must be nested under the \`props\` key, e.g.:`
+
`Additional keys were returned from \`getStaticProps\`. Properties intended for your component must be nested under the \`props\` key, e.g.:`
+
`\n\n\treturn { props: { title: 'My Title', content: '...' } }`
+
`\n\n\treturn { props: { title: 'My Title', content: '...' } }`
+
`\n\nKeys that need moved:
${
invalidKeys
.
join
(
', '
)}
.`
`\n\nKeys that need
to be
moved:
${
invalidKeys
.
join
(
', '
)}
.`
)
)
}
}
...
...
test/integration/prerender-invalid-paths/test/index.test.js
View file @
8e1046d9
...
@@ -13,7 +13,7 @@ describe('Legacy Prerender', () => {
...
@@ -13,7 +13,7 @@ describe('Legacy Prerender', () => {
expect
(
out
.
stderr
).
toMatch
(
`Build error occurred`
)
expect
(
out
.
stderr
).
toMatch
(
`Build error occurred`
)
expect
(
out
.
stderr
).
toMatch
(
'Additional keys were returned from'
)
expect
(
out
.
stderr
).
toMatch
(
'Additional keys were returned from'
)
expect
(
out
.
stderr
).
toMatch
(
'return { params: { foo: ..., post: ... } }'
)
expect
(
out
.
stderr
).
toMatch
(
'return { params: { foo: ..., post: ... } }'
)
expect
(
out
.
stderr
).
toMatch
(
'Keys that need moved: foo, baz.'
)
expect
(
out
.
stderr
).
toMatch
(
'Keys that need
to be
moved: foo, baz.'
)
})
})
})
})
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment