sst / open-next

Open source Next.js serverless adapter
https://open-next.js.org
MIT License
3.7k stars 111 forks source link

next/image `url` param is incorrect when using `basePath` #388

Closed khalil-omer closed 3 months ago

khalil-omer commented 3 months ago

Using 3.0.0-rc.8, with 'app' as the basePath, this URL is attempted to be fetched but fails:

/app/_next/image?url=%2Fsplash-screen-icon.png&w=96&q=75

This is the correct URL that should be fetched, which works:

/app/_next/image?url=%2Fapp%2Fsplash-screen-icon.png&w=96&q=75

This was discussed in https://github.com/sst/ion/issues/15 however I believe the fix would be in OpenNext, not SST. If I'm incorrect I'll reopen that issue.

conico974 commented 3 months ago

Looks like this is the intended behaviour https://nextjs.org/docs/app/api-reference/next-config-js/basePath#images

khalil-omer commented 3 months ago

That's surprising to me, but you are indeed correct, thanks for reviewing.