question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`next.config.js` is not considered for node_modules that import `next/image`

See original GitHub issue

What version of Next.js are you using?

12.0.3

What version of Node.js are you using?

16.x

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

next start

Describe the Bug

Getting an error during next dev when a dependency imports next/image:

Error: Invalid src prop (https://i.imgur.com/CgezKMb.jpg) on next/image, hostname “i.imgur.com” is not configured under images in your next.config.js See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host

Expected Behavior

Should read the next.config.js properly, even for 3rd party packages inside node_modules that import next/image

To Reproduce

https://github.com/pacocoursey/next-image-bug

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:11
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
styflecommented, Feb 9, 2022

This was released in 12.0.11-canary.10.

You can try it out today with npm i next@canary or yarn add next@canary, thanks!

1reaction
styflecommented, Feb 4, 2022

We’ll have it for 12.1.0.

The work is being done in PR #33559

Read more comments on GitHub >

github_iconTop Results From Across the Web

next.config.js: Introduction
next.config.js is a regular Node.js module, not a JSON file. It gets used by the Next.js server and build ... Phases can be...
Read more >
Support ESM in next.config.js - Stack Overflow
From Next.js 12, ES modules is now supported in the config file by renaming it to next.config.mjs . // next.config.mjs import withLess from ......
Read more >
Building a Next.js shopping cart app - LogRocket Blog
Setting up a Next.js project with create-next-app ... Now, to use the styles inside the component, import the CSS module, and add className ......
Read more >
Next.js Tutorial for Beginners (Getting Started) | Stack Diary
Layout settings in _app.js; Using an API to fetch and render data (getStaticProps, getServerSideProps); How to use global.css and CSS modules ...
Read more >
How to Build Your Own Blog with Next.js and MDX
MDX brings this flexibility into a markdown file by allowing you to literally write or import JavaScript (React) components into your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found