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

Support basePath in Nextjs #15

Closed
khalil-omer opened this issue Feb 29, 2024 · 2 comments
Closed

Support basePath in Nextjs #15

khalil-omer opened this issue Feb 29, 2024 · 2 comments

Comments

@khalil-omer
Copy link
Contributor

As described in this issue in sst/sst and as addressed in this sst/sst PR, if basePath is set in next.config.js, sst/ion ignores that path when defining Cloudfront routes, so Next expects assets at /basepath/_next/foo but Cloudfront is serving them at _next/foo.

@fwang
Copy link
Contributor

fwang commented Mar 15, 2024

Update release v0.0.147 with OpenNext 3.0.0-rc.8. basePath should now be supported.

Feel free to re-open this if still not supported.

@fwang fwang closed this as completed Mar 15, 2024
@khalil-omer
Copy link
Contributor Author

@fwang thanks, I agree this is fixed as far as routing, but seeing one bug with next/image. I'll open an issue in the open-next repo.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants