본문으로 건너뛰기
Minsing Log
뒤로 가기

Error report: 오타를 조심하자

Programming & CS

Situation

I tried to get image cover at notion to show notion cover photo in my portfolio site. I get cover url at query data list and show notion data base cover in my portfolio_site.

import Image from "next/image";

export default function ProjectItem({data}){
	
	const Title = data.properties.Name.title[0].plain_text
	const githublink = data.properties.Github.url
	const youtubelink = data.properties.Youtube.url
	const description = data.properties.Description.rich_text[0].plain_text
	const imgSrc = data.cover.file?.url || data.cover.external.url 
	
	console.log(imgSrc)
			
			
	return (
		<div className="flex flex-col p-6 m-3 bg-slate-700 rounded-md">
			
		<a>
			<Image 
				scr={imgSrc}
				width={100}
				height={60}
			/>	
		</a>
			
			
			<h1>{Title}</h1>
			<h3>{description}</h3>
			<a href={githublink}>깃허브 바로가기</a>
			<a href={youtubelink}>유튜브 시연영상 보러가기</a>
		</div>
	);`
	
}

But images are corrupted in my site like this.

Trial1

So I attempt to modify next.config.js. I made images domain arrary.

But nothing is solved.

Trial2

And I tried console.log to check if image source links are get in const imageSrc. enter image description here

It is good to receive image source links.

What is wrong with my code? Is that I something to miss out?

Solved

-> 단순 scr을 src로 바꿔야하는 오타 문제였다… 이미지가 안불러와지는건 태그의 src의 오타로 링크가 안불러와진것! ㅠㅠ

Plus Error solution) https://nextjs.org/docs/messages/next-image-unconfigured-host

공개 여정 구독

글이 올라오면 이메일로 보내드릴게요.

개발, 창업, 배움, 실패와 회고를 짧고 솔직하게 기록합니다. 검색으로 스쳐가는 독자가 아니라 여정을 따라오는 팬을 만들기 위한 뉴스레터입니다.

뉴스레터는 준비 중입니다. 그동안 RSS 로 구독하거나 이메일 로 알림을 요청해 주세요.


이 글 공유하기:

댓글

GitHub 계정으로 로그인해 댓글을 남길 수 있습니다.


이전 글
Git flow
다음 글
ErrorNote: error - TypeError: Cannot read properties of undefined (reading 'map') 해결