-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
143 additions
and
76 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
packages/next-swc/crates/core/tests/errors/next-dynamic/no-arguments/output.stderr
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,6 +1,7 @@ | ||
|
||
x next/dynamic requires at least one argument | ||
,-[input.js:3:1] | ||
,-[input.js:2:1] | ||
2 | | ||
3 | const DynamicComponent = dynamic() | ||
: ^^^^^^^ | ||
`---- |
4 changes: 3 additions & 1 deletion
4
packages/next-swc/crates/core/tests/errors/next-dynamic/options-as-variable/output.stderr
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,7 +1,9 @@ | ||
|
||
x next/dynamic options must be an object literal. | ||
| Read more: https://nextjs.org/docs/messages/invalid-dynamic-options-type | ||
,-[input.js:4:1] | ||
,-[input.js:3:1] | ||
3 | const options = { loading: () => <p>...</p>, ssr: false } | ||
4 | const DynamicComponentWithCustomLoading = dynamic( | ||
: ^^^^^^^ | ||
5 | () => import('../components/hello'), | ||
`---- |
4 changes: 3 additions & 1 deletion
4
packages/next-swc/crates/core/tests/errors/next-dynamic/too-many-arguments/output.stderr
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,6 +1,8 @@ | ||
|
||
x next/dynamic only accepts 2 arguments | ||
,-[input.js:3:1] | ||
,-[input.js:2:1] | ||
2 | | ||
3 | const DynamicComponentWithCustomLoading = dynamic( | ||
: ^^^^^^^ | ||
4 | () => import('../components/hello'), | ||
`---- |
7 changes: 5 additions & 2 deletions
7
packages/next-swc/crates/core/tests/errors/next-font-loaders/export-let/output.stderr
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,12 +1,15 @@ | ||
|
||
x Font loader calls must be assigned to a const | ||
,-[input.js:4:1] | ||
,-[input.js:3:1] | ||
3 | | ||
4 | export let firaCode = Abel() | ||
: ^^^^^^^^^^^^^^^^^^^^^ | ||
5 | export var inter = Inter() | ||
`---- | ||
|
||
x Font loader calls must be assigned to a const | ||
,-[input.js:5:1] | ||
,-[input.js:4:1] | ||
4 | export let firaCode = Abel() | ||
5 | export var inter = Inter() | ||
: ^^^^^^^^^^^^^^^^^^^ | ||
`---- |
6 changes: 4 additions & 2 deletions
6
packages/next-swc/crates/core/tests/errors/next-font-loaders/not-const/output.stderr
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
8 changes: 6 additions & 2 deletions
8
packages/next-swc/crates/core/tests/errors/next-font-loaders/not-ident/output.stderr
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,12 +1,16 @@ | ||
|
||
x Font loader calls must be assigned to an identifier | ||
,-[input.js:3:1] | ||
,-[input.js:2:1] | ||
2 | | ||
3 | const { a } = Inter({ | ||
: ^^^^^ | ||
4 | variant: '400', | ||
`---- | ||
|
||
x Font loader calls must be assigned to an identifier | ||
,-[input.js:7:1] | ||
,-[input.js:6:1] | ||
6 | | ||
7 | const [b] = Inter({ | ||
: ^^^ | ||
8 | variant: '400', | ||
`---- |
12 changes: 8 additions & 4 deletions
12
packages/next-swc/crates/core/tests/errors/next-font-loaders/options-object/output.stderr
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,24 +1,28 @@ | ||
|
||
x Unexpected object key type | ||
,-[input.js:4:1] | ||
,-[input.js:3:1] | ||
3 | const a = fn({ 10: 'hello' }) | ||
4 | const a = ABeeZee({ 10: 'hello' }) | ||
: ^^ | ||
`---- | ||
|
||
x Font loader values must be explicitly written literals. | ||
,-[input.js:7:1] | ||
,-[input.js:6:1] | ||
6 | const a = fn({ variant: [i1] }) | ||
7 | const a = ABeeZee({ variant: [i1] }) | ||
: ^^ | ||
`---- | ||
|
||
x Font loader values must be explicitly written literals. | ||
,-[input.js:10:1] | ||
,-[input.js:9:1] | ||
9 | const a = fn({ variant: () => {} }) | ||
10 | const a = ABeeZee({ variant: () => {} }) | ||
: ^^^^^^^^ | ||
`---- | ||
|
||
x Unexpected spread | ||
,-[input.js:13:1] | ||
,-[input.js:12:1] | ||
12 | const a = fn({ ...{} }) | ||
13 | const a = ABeeZee({ ...{} }) | ||
: ^^^ | ||
`---- |
6 changes: 4 additions & 2 deletions
6
packages/next-swc/crates/core/tests/errors/next-font-loaders/spread-arg/output.stderr
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,12 +1,14 @@ | ||
|
||
x Font loaders don't accept spreads | ||
,-[input.js:4:1] | ||
,-[input.js:3:1] | ||
3 | const a = fn(...{}, ...[]) | ||
4 | const inter = Inter(...{}, ...[]) | ||
: ^^^ | ||
`---- | ||
|
||
x Font loaders don't accept spreads | ||
,-[input.js:4:1] | ||
,-[input.js:3:1] | ||
3 | const a = fn(...{}, ...[]) | ||
4 | const inter = Inter(...{}, ...[]) | ||
: ^^^ | ||
`---- |
32 changes: 20 additions & 12 deletions
32
packages/next-swc/crates/core/tests/errors/next-font-loaders/wrong-scope/output.stderr
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,30 +1,38 @@ | ||
|
||
x Font loaders must be called and assigned to a const in the module scope | ||
,-[input.js:3:1] | ||
,-[input.js:2:1] | ||
2 | | ||
3 | Aladin({}) | ||
: ^^^^^^ | ||
`---- | ||
|
||
x Font loaders must be called and assigned to a const in the module scope | ||
,-[input.js:6:1] | ||
,-[input.js:5:1] | ||
5 | let b | ||
6 | const a = (b = Aladin({ variant: '400' })) | ||
: ^^^^^^ | ||
`---- | ||
|
||
x Font loaders must be called and assigned to a const in the module scope | ||
,-[input.js:9:3] | ||
9 | const a = Aladin({ | ||
: ^^^^^^ | ||
`---- | ||
,-[input.js:8:1] | ||
8 | function Hello() { | ||
9 | const a = Aladin({ | ||
: ^^^^^^ | ||
10 | variant: '400', | ||
`---- | ||
|
||
x Font loaders must be called and assigned to a const in the module scope | ||
,-[input.js:16:5] | ||
16 | Aladin({ | ||
: ^^^^^^ | ||
,-[input.js:15:1] | ||
15 | constructor() { | ||
16 | Aladin({ | ||
: ^^^^^^ | ||
17 | variant: '400', | ||
`---- | ||
|
||
x Font loaders must be called and assigned to a const in the module scope | ||
,-[input.js:23:3] | ||
23 | Aladin({}) | ||
: ^^^^^^ | ||
,-[input.js:22:1] | ||
22 | { | ||
23 | Aladin({}) | ||
: ^^^^^^ | ||
24 | } | ||
`---- |
3 changes: 2 additions & 1 deletion
3
...s/next-swc/crates/core/tests/errors/next-ssg/server-side-after-static-paths/output.stderr
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,6 +1,7 @@ | ||
|
||
x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps | ||
,-[input.js:2:1] | ||
,-[input.js:1:1] | ||
1 | export async function getStaticPaths() {} | ||
2 | export const getServerSideProps = function getServerSideProps() {} | ||
: ^^^^^^^^^^^^^^^^^^ | ||
`---- |
5 changes: 3 additions & 2 deletions
5
...s/next-swc/crates/core/tests/errors/next-ssg/server-side-after-static-props/output.stderr
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,6 +1,7 @@ | ||
|
||
x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps | ||
,-[input.js:2:1] | ||
2 | export { a as getServerSideProps } | ||
,-[input.js:1:1] | ||
1 | const getStaticProps = async () => {} | ||
2 | export { a as getServerSideProps } | ||
: ^^^^^^^^^^^^^^^^^^ | ||
`---- |
3 changes: 2 additions & 1 deletion
3
...s/next-swc/crates/core/tests/errors/next-ssg/static-paths-after-server-side/output.stderr
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,6 +1,7 @@ | ||
|
||
x You can not use getStaticProps or getStaticPaths with getServerSideProps. To use SSG, please remove getServerSideProps | ||
,-[input.js:2:1] | ||
,-[input.js:1:1] | ||
1 | export { a as getServerSideProps } from './input' | ||
2 | export { getStaticPaths } from 'a' | ||
: ^^^^^^^^^^^^^^ | ||
`---- |
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
,-[input.js:1:1] | ||
1 | export function getServerSideProps (){ | ||
: ^^^^^^^^^^^^^^^^^^ | ||
2 | } | ||
`---- |
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
,-[input.js:1:1] | ||
1 | export function getStaticProps (){ | ||
: ^^^^^^^^^^^^^^ | ||
2 | } | ||
`---- |
3 changes: 2 additions & 1 deletion
3
...c/crates/core/tests/errors/react-server-components/client-graph/server-only/output.stderr
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,6 +1,7 @@ | ||
|
||
x NEXT_RSC_ERR_CLIENT_IMPORT: server-only | ||
,-[input.js:9:1] | ||
,-[input.js:8:1] | ||
8 | | ||
9 | import "server-only" | ||
: ^^^^^^^^^^^^^^^^^^^^ | ||
`---- |
3 changes: 2 additions & 1 deletion
3
...wc/crates/core/tests/errors/react-server-components/client-graph/use-client/output.stderr
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,6 +1,7 @@ | ||
|
||
x NEXT_RSC_ERR_CLIENT_DIRECTIVE | ||
,-[input.js:3:1] | ||
,-[input.js:2:1] | ||
2 | | ||
3 | "use client" | ||
: ^^^^^^^^^^^^ | ||
`---- |
3 changes: 2 additions & 1 deletion
3
...c/crates/core/tests/errors/react-server-components/server-graph/client-only/output.stderr
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,6 +1,7 @@ | ||
|
||
x NEXT_RSC_ERR_SERVER_IMPORT: client-only | ||
,-[input.js:9:1] | ||
,-[input.js:8:1] | ||
8 | | ||
9 | import "client-only" | ||
: ^^^^^^^^^^^^^^^^^^^^ | ||
`---- |
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
,-[input.js:1:1] | ||
1 | export function getServerSideProps (){ | ||
: ^^^^^^^^^^^^^^^^^^ | ||
2 | } | ||
`---- |
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
,-[input.js:1:1] | ||
1 | export function getStaticProps (){ | ||
: ^^^^^^^^^^^^^^ | ||
2 | } | ||
`---- |
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
Oops, something went wrong.