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

updated 2614 error explanation #341

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/engine/errors/2614.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
---
original: "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"
original: >
The file "next/image" only exports a single entity, which is exported by default.
You must have written 'export default {component};' somewhere, which means that this particular file exports only this 'component'.
Thus, whenever you are going to import this component into some other file, you must write:
import component from 'next/file'.

However, if you write it as:
import {component} from 'next/file',
it would mean that this component from this file is a named export.
A named export means that a file already has a default export, and the 'component' you are trying to import is exported by other means.

So, in our case, this error arises because the file "next/image" is exporting the Image as a default export, not as a named export.
Therefore, we must import it as:
import Image from 'next/image'.

---

'{1}' is not one of the things exported from '{0}'. Did you mean to import '{1}' from '{0}' instead?