You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Error in ./pages/index.js
Module build failed: TypeError: /home/isabelle/learnnextjs-demo/pages/index.js: Duplicate declaration "Index"
8 | import Link from 'next/link'
9 |
10 | const Index = () => (
| ^
11 |
12 |
13 | About Page
at File.buildCodeFrameError (/home/isabelle/learnnextjs-demo/node_modules/@babel/core/lib/transformation/file/file.js:207:12)
at Scope.checkBlockScopedCollisions (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/scope/index.js:295:27)
at Scope.registerBinding (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/scope/index.js:479:16)
at Scope.registerDeclaration (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/scope/index.js:398:14)
at Object.BlockScoped (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/scope/index.js:146:28)
at Object.newFn (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/visitors.js:266:17)
at NodePath._call (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/path/context.js:64:19)
at NodePath.call (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/path/context.js:34:14)
at NodePath.visit (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/path/context.js:99:12)
at TraversalContext.visitQueue (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/context.js:135:18)
at TraversalContext.visitMultiple (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/context.js:89:17)
at TraversalContext.visit (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/context.js:174:19)
at Function.traverse.node (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/index.js:76:17)
at traverse (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/index.js:46:12)
at NodePath.traverse (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/path/index.js:140:24)
at Scope.crawl (/home/isabelle/learnnextjs-demo/node_modules/@babel/traverse/lib/scope/index.js:695:10)`
I don't know what is false on my index.js :
`const Index = () => (
Hello Next.js
)
// This is the Link API
import Link from 'next/link'
const Index = () => (
About Page
Hello Next.js
)
export default Index`
Thanks for your answers!
The text was updated successfully, but these errors were encountered:
Hello
When I try to add the following code into pages/index.js :
`// This is the Link API
import Link from 'next/link'
const Index = () => (
Hello Next.js
export default Index`
Then I get this error on http://localhost:3000/
`Error in ./pages/index.js
Module build failed: TypeError: /home/isabelle/learnnextjs-demo/pages/index.js: Duplicate declaration "Index"
8 | import Link from 'next/link'
9 |
I don't know what is false on my index.js :
`const Index = () => (
Hello Next.js
// This is the Link API
import Link from 'next/link'
const Index = () => (
Hello Next.js
export default Index`
Thanks for your answers!
The text was updated successfully, but these errors were encountered: