Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next Image types prevent building since 11.1.1 #28812

Closed
nbouvrette opened this issue Sep 5, 2021 · 5 comments
Closed

Next Image types prevent building since 11.1.1 #28812

nbouvrette opened this issue Sep 5, 2021 · 5 comments
Labels
bug Issue was opened via the bug report template.

Comments

@nbouvrette
Copy link
Contributor

What version of Next.js are you using?

11.1.1

What version of Node.js are you using?

v14.17.5

What browser are you using?

Chrome

What operating system are you using?

Windows

How are you deploying your application?

Vercel

Describe the Bug

While trying to upgrade Next.js I ran into the following build error that seems to be triggered by Next.js 11.1.1:

node_modules/next/types/index.d.ts:46:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'loading' must be of type '"eager" | "lazy"', but here has type '"auto" | "eager" | "lazy"'.

46     loading?: 'auto' | 'eager' | 'lazy'
       ~~~~~~~

  node_modules/@types/react/index.d.ts:2156:9
    2156         loading?: "eager" | "lazy" | undefined;
                 ~~~~~~~
    'loading' was also declared here.


Found 1 error.

Expected Behavior

Build should work.

To Reproduce

Install Next.js 11.1.1 with @types/react ^17.0.20, and open node_modules\next\types\index.d.ts to see the IDE error on line 46.

@nbouvrette nbouvrette added the bug Issue was opened via the bug report template. label Sep 5, 2021
@nbouvrette
Copy link
Contributor Author

This issue seems related to this PR: #28672

I tried to downgrade to @types/node": "^16.7.10 and still got the same build error.

@stefanprobst
Copy link
Contributor

i think this should already be fixed by the pr you linked above. can you try with yarn add next@canary?

@timneutkens
Copy link
Member

Indeed, it's been fixed already and is out on canary 👍

@nbouvrette
Copy link
Contributor Author

@stefanprobst @timneutkens thanks for some reason I didn't realize it was the fix.

By the way a quick note, it looks like it's not possible to install @canary with npm (not sure if anyone uses it):

$ npm i -D next@canary
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: next@11.1.3-canary.7
npm ERR! node_modules/next
npm ERR!   dev next@"11.1.3-canary.7" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer next@">=10.2.0" from eslint-config-next@11.1.2
npm ERR! node_modules/eslint-config-next
npm ERR!   dev eslint-config-next@"^11.1.2" from the root project

Should open another issue for this?

It seems to be coming from \node_modules\eslint-config-next\package.json

  "peerDependencies": {
    "next": ">=10.2.0",
  },

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

4 participants