-
Notifications
You must be signed in to change notification settings - Fork 96
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
links in index.html does not contain .html
suffix, but generated html files has
#45
Comments
At a basic level, setting |
How do you enable that? |
You can set it in next.config.js: https://nextjs.org/docs/api-reference/next.config.js/trailing-slash |
For anyone coming to this issue looking to apply this fix, you can use patch-package while we wait for this change to be merged: The autogenerated output from patch-package is below :) Hi! 👋 Firstly, thanks for your work on this project! 🙂 Today I used patch-package to patch Here is the diff that solved my problem: diff --git a/node_modules/@log4brains/web/dist/next.config.js b/node_modules/@log4brains/web/dist/next.config.js
index a5dd2e9..4d14fab 100644
--- a/node_modules/@log4brains/web/dist/next.config.js
+++ b/node_modules/@log4brains/web/dist/next.config.js
@@ -13,6 +13,16 @@ module.exports = withBundleAnalyzer({
reactStrictMode: true,
target: "serverless",
poweredByHeader: false,
+ /**
+ * This patch is to ensure that next outputs page/index.html instead of page.html
+ * Without this, links to pages other than the index file will not work on s3
+ *
+ * without:
+ * .log4brains/out/adr/2022022-document-frontend-infra-decisions.html
+ * with:
+ * .log4brains/out/adr/2022022-document-frontend-infra-decisions/index.html
+ */
+ trailingSlash: true,
serverRuntimeConfig: {
PROJECT_ROOT: __dirname, // https://github.com/vercel/next.js/issues/8251
VERSION: process.env.HIDE_LOG4BRAINS_VERSION ? "" : packageJson.version This issue body was partially generated by patch-package. |
See thomvaill#45 for context.
ADRs are now generated to adr/<name>/index.html instead of adr/<name>.html. See #45 for context.
LGTM. Thank you all |
Bug Report
Description
links in index.html does not contain
.html
suffix, but generated html files has.Steps to Reproduce
Expected Behavior
should generated links with
.html
suffixContext
Environment
Possible Solution
found this question: https://stackoverflow.com/questions/62867105/how-to-deal-with-nextjs-exporting-files-with-html-extension-but-inlink-there
maybe we should add this for Next framework.
The text was updated successfully, but these errors were encountered: