nextjs-notion-starter-kit icon indicating copy to clipboard operation
nextjs-notion-starter-kit copied to clipboard

Notion Image do not load

Open AnshumanFauzdar opened this issue 1 year ago • 16 comments

Description

image Image do not load up and throw {"message":"Something went wrong."} error.

Notion Test Page ID

bd999537dba44d68be67cbcf11ee6199

AnshumanFauzdar avatar Mar 10 '23 09:03 AnshumanFauzdar

Did you add allowed image domains in next site config?

You can refer - https://stackoverflow.com/questions/66533981/next-image-configuration-in-next-js-config-file

heypratik avatar Mar 13 '23 08:03 heypratik

@heypratik It was working without this image domain, is there any upgrade or dependency introduced which caused this issue?

AnshumanFauzdar avatar Mar 13 '23 09:03 AnshumanFauzdar

Same thing happens. image The image urls api gives are invalid. ex) https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Fs%2F2f3dca95-eec5-4117-b336-6a748a5ddddd%2FUntitled.png%3Ftable%3Dblock%26id%3D24640f83-bca7-46e9-b096-388e696fa8c2%26expirationTimestamp%3D1679017640323%26signature%3DhTyG5u5jozwOeA33Rd3qxpyU1FoZw81tqC_Lh84zLBU?table=block&id=24640f83-bca7-46e9-b096-388e696fa8c2&cache=v2

image domains are allowed in next site config.

JYeop avatar Mar 16 '23 01:03 JYeop

I found the reason. See https://github.com/NotionX/react-notion-x/issues/441

JYeop avatar Mar 16 '23 02:03 JYeop

It fixed for me when I added file.notion.so in next.config.js in the domains array inside images.

adayush avatar Mar 22 '23 17:03 adayush

It fixed for me when I added file.notion.so in next.config.js in the domains array inside images.

still not work for me.

ZuopieziChen avatar Mar 25 '23 01:03 ZuopieziChen

I am facing the same problem. Images on my blog do not show and when I try to access the src from browser it raise {"message":"Something went wrong."}. One example page is https://www.richardsong.space/l2-risk where images in original notion page do not show. I have tried method mentioned by @adayush, it cannot work for me😥

RichardS0268 avatar Mar 26 '23 14:03 RichardS0268

I have the same problem, the domain of the image is "file.notion.so" and when I access that image URL, it always returns {"message":"Something went wrong."} I try to "file.notion.so" domain to next.config.js but it doesn't work

congnt24 avatar Mar 29 '23 02:03 congnt24

same issue here. any update here? this is a pretty big issue IMO. It seems to only be private page images

0xFloyd avatar Apr 17 '23 13:04 0xFloyd

@0xFloyd I didn't change anything and now its working as usual.

AnshumanFauzdar avatar Apr 26 '23 04:04 AnshumanFauzdar

It works for now

Gumball12 avatar Apr 30 '23 05:04 Gumball12

I am facing the same problem. Images on my blog do not show and when I try to access the src from browser it raise {"message":"Something went wrong."}. One example page is https://www.richardsong.space/l2-risk where images in original notion page do not show. I have tried method mentioned by @adayush, it cannot work for me😥

notion using Amazon’s cdn,its‘ period time is about one day(24hours),the static resources like src in html only Effective within 24 hours

minesunny avatar Jul 12 '23 07:07 minesunny

I am facing the same problem. Images on my blog do not show and when I try to access the src from browser it raise {"message":"Something went wrong."}. One example page is https://www.richardsong.space/l2-risk where images in original notion page do not show. I have tried method mentioned by @adayush, it cannot work for me😥

notion using Amazon’s cdn,its‘ period time is about one day(24hours),the static resources like src in html only Effective within 24 hours

I am facing the same problem. Images on my blog do not show and when I try to access the src from browser it raise {"message":"Something went wrong."}. One example page is https://www.richardsong.space/l2-risk where images in original notion page do not show. I have tried method mentioned by @adayush, it cannot work for me😥

I wanted to set static resources cnd cache lessthan 24hours,so that images' url can be valid,but I failed;Then,you can set a schedule task(less than 24 hours) to redeloy your project ,so that can refresh static resources

minesunny avatar Jul 12 '23 08:07 minesunny

If you deployed on local,see this https://github.com/transitive-bullshit/nextjs-notion-starter-kit/issues/463#issuecomment-1632029991;If you deployed on vercel,I can explain why notion image can't load ? Vercel using next.js as Server render, For free personal,the timeout of function getStaticProps with limited in 10s,if some request timeout,it would use resource which last compiled (hold old timeStamp image url);seeing this image; I configed navigationLinks,navigationStyle in site.config.ts and caused that problem. navigationStyle with not default will request more notion's api, you can solve this problem from here. image

minesunny avatar Jul 17 '23 12:07 minesunny

How did you guys solve it? I'm facing the same thing it only works when I refresh the page or switching the light mode, but it never works the first time you visited it, such a bad user experience : (

For example, one of my failing image address is https://www.sivan.fun/_next/image?url=https%3A%2F%2Fwww.notion.so%2Fimage%2Fhttps%253A%252F%252Ffile.notion.so%252Ff%252Fs%252F0645a5ce-1e52-4aef-977b-e05a606611a4%252FUntitled.png%253Fid%253D13c21c56-8a17-44dd-87fa-9818614d7551%2526table%253Dblock%2526spaceId%253Db74133af-844e-4972-b144-c12554ed8914%2526expirationTimestamp%253D1698350400000%2526signature%253DYCU8p7ySl0bT7GcabU1W0wVmJbVVOz6C6TKJFHUxTd8%3Ftable%3Dblock%26id%3D13c21c56-8a17-44dd-87fa-9818614d7551%26cache%3Dv2&w=3840&q=75

And when I open it in new page, it shows:

400: BAD_REQUEST
Code: INVALID_IMAGE_OPTIMIZE_REQUEST
ID: iad1::b6d7n-1698260486516-913b8605f5e4

sivannavis avatar Oct 25 '23 18:10 sivannavis

Getting something similar in my deployment recently. I wonder if Notion changed some header in their image responses?

jacksongoode avatar Feb 13 '24 19:02 jacksongoode