basePath support broken in 1.19.0
See original GitHub issueDescribe the bug
When using the basePath and trailingSlash settings in next.config.js, the lambda creates an incorrect url in serverless-component 1.19.0-alpha.27
Actual behavior
With this config in next.config.js:
module.exports = {
trailingSlash: true,
basePath: "/nl"
...
}
When I do the following request:
curl -v https://xxxxxxx.cloudfront.net/nl/zoek
I get this response:
< HTTP/2 308
< content-length: 0
< server: CloudFront
< date: Mon, 18 Jan 2021 08:41:00 GMT
< location: /nl%2Fzoek/
< refresh: 0;url=/nl%2Fzoek/
Expected behavior
When I do this response curl -v https://xxxxxxx.cloudfront.net/nl/zoek
I expect the page zoek.tsx
to be rendered.
Steps to reproduce
Configure basePath & trailingSlash & deploy with serverless-component 1.19.0
Versions
- @sls-next/serverless-component version: @sls-next/serverless-component@1.19.0-alpha.27
- Next.js version: 10.0.4
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Minecraft Bedrock's Mobile Controls are BROKEN in 1.19...
With Minecraft Bedrock Edition's recent update to 1.19.0 (The Wild Update), it came with some bugs, to the surprise of no one.
Read more >Changelog - ReadonlyREST
basePath " kibana option implementation. Enhancement (KBN) Support full regex in kibana_hidden_apps rule. Enhancement Crash if Kibana is not patched.
Read more >Changelog — drf-yasg 1.20.1 documentation
Support was dropped for Python 3.5, Django 2.0, Django 2.1, DRF 3.7 ... FIXED: fixed broken CSS when USE_SESSION_AUTH=False; FIXED: fixed implementation of ......
Read more >rollup changelog
Fix a situation where invalid code was rendered when dynamically importing a module with synthetic named exports when preserving modules (#3738) ...
Read more >4.8.38 - Release Status
Bug 2066675: Ensure IOPS setting is honoured on all supported block device types #437 ... Bug 1804230: fix broken ETCD link in user...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed and published in
@sls-next/serverless-component@1.19.0-alpha.28
Ah, thanks, I think it seems to be a similar issue as in: https://github.com/serverless-nextjs/serverless-next.js/pull/868. Because Next.js changed their internal redirect regex for Next 10.0.3 and then again in 10.0.4, we needed to add it to our list to remove since we have our own redirect for trailing slash (the reason is for better performance). We need to remove these from
routes-manifest.json
as they interfere with our own redirects:It looks like for Next 10.0.4 there is a new
internal
property added so we can easily identify it.Edit: as a side note, I also need to figure out why the e2e tests didn’t catch it as it should install the latest Next 10.0.x version each time (no cache or anything)