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

fix: missing hash query param in load hook for virtual conf #2212

Merged
merged 1 commit into from
Jul 8, 2023
Merged

fix: missing hash query param in load hook for virtual conf #2212

merged 1 commit into from
Jul 8, 2023

Conversation

userquin
Copy link
Collaborator

@userquin userquin commented Jul 8, 2023

πŸ”— Linked issue

#2211

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Resolves #2211

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@userquin userquin marked this pull request as draft July 8, 2023 15:52
@kazupon kazupon marked this pull request as ready for review July 8, 2023 19:07
Copy link
Collaborator

@kazupon kazupon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR!

Oh, I deleted the hash, that was my mistake πŸ˜“
Thanks!

@kazupon kazupon merged commit 6a110af into nuxt-modules:next Jul 8, 2023
@userquin
Copy link
Collaborator Author

userquin commented Jul 8, 2023

@kazupon still not working, I've been trying to fix the error for 2 days, the PR was in draft

@userquin userquin deleted the fix-missing-hash-query-param branch July 8, 2023 20:01
kazupon added a commit that referenced this pull request Jul 9, 2023
@kazupon
Copy link
Collaborator

kazupon commented Jul 9, 2023

@userquin
You can send the PR again!

@userquin
Copy link
Collaborator Author

userquin commented Jul 9, 2023

@kazupon the problem is this:

debug output: SSR
isSSG false                                                                                                                                                               11:48:43  
useCookie on setup false                                                                                                                                                  11:48:43  
defautlLocale on setup en-US                                                                                                                                              11:48:43  
detectLocale: initialLocale - en-US                                                                                                                                       11:48:43  
detectLocale: detectBrowserLanguage (browserLocale, stat, reason, from) -  false unknown unknown                                                                          11:48:43  
detectLocale: finaleLocale first (finaleLocale, strategy) -  no_prefix                                                                                                    11:48:43  
detectLocale: finaleLocale second (finaleLocale, detectBrowserLanguage) - en-US false                                                                                     11:48:43  
detectLocale: finalLocale last (finalLocale, defaultLocale) - en-US en-US                                                                                                 11:48:43  
detectLocale: finalLocale - en-US                                                                                                                                         11:48:43  
first detect initial locale en-US                                                                                                                                         11:48:43  
final initial locale: en-US                                                                                                                                               11:48:43  
locale-changing middleware {                                                                                                                                              11:48:43  
  fullPath: '/_nuxt/@id/__x00__@nuxtjs/i18n/null',
  hash: '',
  query: {},
  name: undefined,
  path: '/_nuxt/@id/__x00__@nuxtjs/i18n/null',
  params: {},
  matched: [],
  meta: {},
  redirectedFrom: undefined,
  href: '/_nuxt/@id/__x00__@nuxtjs/i18n/null'
} {
  fullPath: '/_nuxt/@id/__x00__@nuxtjs/i18n/null',
  path: '/_nuxt/@id/__x00__@nuxtjs/i18n/null',
  query: {},
  hash: '',
  name: undefined,
  params: {},
  matched: [],
  meta: {},
  redirectedFrom: undefined,
  href: '/_nuxt/@id/__x00__@nuxtjs/i18n/null'
}
Configuration
// nuxt.config.ts
i18n: {
    locales: availableLocales,
    lazy: true,
    strategy: 'no_prefix',
    detectBrowserLanguage: false, /* {      fallbackLocale: 'en-US',
      useCookie: false,
    } */
    langDir,
    defaultLocale: 'en-US',
    types: 'composition',
    pages: undefined,
    dynamicRouteParams: false,
    skipSettingLocaleOnNavigate: true,
    debug: true,
    vueI18n: './config/i18n.config.ts',
  },
// ./config/i18n.config.ts
import { availableLocales, datetimeFormats, numberFormats, pluralRules } from './i18n'

export default {
  legacy: false,
  availableLocales: availableLocales.map(l => l.code),
  fallbackLocale: 'en-US',
  fallbackWarn: true,
  pluralRules,
  datetimeFormats,
  numberFormats,
  globalInjection: true,
  missingWarn: true,
}

@userquin
Copy link
Collaborator Author

userquin commented Jul 10, 2023

@kazupon reverted wrong commit, you should revert only #2212, the lazy load is ok, the ternary is wrong: #2193 PR should be in next branch

@userquin
Copy link
Collaborator Author

It seems we need to extract the locale from another place, query.locale seems to be null, should extracted from the path

imagen

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 this pull request may close these issues.

missing query hash param when loading virtual conf
2 participants