fix(nuxt): opt renderer route out of i18n localization - #208
Open
sandros94 wants to merge 3 commits into
Open
Conversation
Author
|
This should also theoretically work with nuxt-i18n-micro. But if it doesn't I would honestly prefer to add EDIT: spaned a fable to doublecheck this, no it does not support |
Author
|
Pushed two more fixes after field-testing this in the wild:
EDIT: also noticed that ts v7 is not working, because compodium is using v5.x api, but this is a different topic |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #171
As per issue description, with
@nuxtjs/i18nandstrategy: 'prefix', i18n localises every page route and removes the unprefixed originals. The renderer placeholder page had no opt-out, so/__compodium__/renderersimply stopped existing: the request 404s (withX-Frame-Options: DENY) and the devtools preview iframe stays blank, which makes it look like a rendering bug instead of a routing one.The fix is basically a one-liner: the placeholder route is now registered with
meta: { i18n: false }, which i18n treats as its highest-precedence route-level opt-out (it wins overdefineI18nRoute()and thepagesconfig). No module detection needed, without i18n the meta key is just a no-op.Also added an i18n fixture + test asserting the renderer responds on the unprefixed path with
strategy: 'prefix'— that's the exact case that had no coverage. Verified it 404s without the fix and passes with it. Other strategies (prefix_except_default,no_prefix) keep an unprefixed default route so they were never affected.Development note:
@nuxtjs/i18nis only added as a devDependency of@compodium/nuxtfor the fixture, nothing ships to consumersI couldn't reproduce this issue vue side with vue-i18n, but I'm not that good on that so I prefer to limit my changes on nuxt