question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enabling i18n causes ISR to break

See original GitHub issue

Issue Summary

ISR stopped working for me on a recent deploy. One of the new features I added was using next.js’s i18n localization. On a bit of a whim, I decided to remove it and redeploy, and now ISR is working again.

Maybe something to do with the Accept Language header being part of the CloudFront cache key when localization is enabled? Or something to do with the localized subpathing (though I only had a single en localization and I was accessing it without a subpath and still had the issue).

I noticed all my x-cache response headers were misses from CloudFront.

Steps to reproduce

For me, adding the following to my next.config.js caused this behaviour:

  i18n: {
    locales: ['en'],
    defaultLocale: 'en',
    localeDetection: false,
  },

Screenshots/Code/Configuration/Logs

This happened a few days ago, and I’m going through the CloudWatch Logs but I don’t actually see any errors on this day in either the Default or Regeneration lambdas.

Versions

Additional context

I would like to spend more time debugging this, but as localization isn’t needed for our initial MVP, I can’t yet justify the time now that I have a workaround that works. However, I still wanted to post the issue in case someone else is having issues with ISR and realises that maybe this is the cause. I may be able to look more into this in the future when we need to start adding localized content.

On the initial issue I commented on, @dphang had this remark

hm yes there is not good e2e test coverage for i18n locales yet, it might be that the path is not translated correctly to hit the regeneration lambda (and save the new page)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
dphangcommented, Sep 3, 2021

No worries! It was a legitimate bug so the report is still useful 😄

0reactions
WarcraftYaxcommented, Sep 2, 2021

Thank you for fixing this! Sorry I wasn’t able to be of more help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found