Skip to content

Conversation

@farnabaz
Copy link
Member

@farnabaz farnabaz commented Nov 18, 2025

… config hook

πŸ”— Linked issue

resolves #3613

❓ 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

This was an attempt to solve #3613. But it seems that it works only if we move route to /api/**.

Nitro cache + server handler on modules:done hook does not work if it is not prefixed with /api /cc @pi0 @atinux

πŸ“ Checklist

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

@vercel
Copy link

vercel bot commented Nov 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
content Ready Ready Preview, Comment Dec 18, 2025 11:14am

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 18, 2025

Deploying content with Β Cloudflare Pages Β Cloudflare Pages

Latest commit: f705a59
Status:Β βœ…Β  Deploy successful!
Preview URL: https://eb6712c1.content-f0q.pages.dev
Branch Preview URL: https://fix-nitro-cache.content-f0q.pages.dev

View logs

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 8, 2025

npm i https://pkg.pr.new/@nuxt/content@3617

commit: f705a59

@farnabaz
Copy link
Member Author

farnabaz commented Dec 8, 2025

@maximepvrt This PR should resolve the issue, I would appreciate if you can verify using pr-release? πŸ™

@maximepvrt
Copy link
Contributor

@farnabaz it's perfect for me ;-) Thanks !

@maximepvrt
Copy link
Contributor

maximepvrt commented Dec 10, 2025

@farnabaz but in this branch/pk.pr.new I have error with yml parcing if I active nitro cache

 nitro: {
        routeRules: {
            '**': {
                cache: {
                    varies: ['host', 'x-forwarded-host']
                }
            },
        }
    }

[@nuxt/content 14:39:38] WARN "devenirBenevole/devenir-benevole/index.yml" is ignored because parsing is failed. Error: Cannot read properties of undefined (reading 'value')

title: Être bénévole
name: Devenir bΓ©nΓ©vole
description: Vous souhaitez vivre une expΓ©rience utile et agrΓ©able par le bΓ©nΓ©volat ? bravo ! Peut-Γͺtre avez vous une idΓ©e trΓ¨s prΓ©cise de ce que vous souhaitez faire. Peut-Γͺtre moins. Nous sommes lΓ  pour vous aider Γ  vous y retrouver !
items:
  - title: S'engager pour une cause
    description: DΓ©couvrez les diffΓ©rents domaines d’activitΓ©s des associations et choisissez
      de faire du bΓ©nΓ©volat dans les causes qui vous tiennent le plus Γ  coeur.
    to: "/devenir-benevole/domaine"
    image: "/devenir-benevole/domaine.svg"
  - title: Agir localement
    description: Les associations recherchent des bΓ©nΓ©voles partout en France. DΓ©couvrez
      les missions de bΓ©nΓ©volat proposΓ©es par les associations locales !
    to: "/devenir-benevole/france"
    image: "/devenir-benevole/france.svg"
  - title: Agir Γ  tout Γ’ge
    description: Que l’on soit Γ©tudiant, jeune actif, demandeur d’emploi, femme, homme,
      retraitΓ©, diplΓ΄mΓ©, dΓ©crocheur, ou dans une toute autre situation, il y a toujours
      une bonne raison de faire du bΓ©nΓ©volat.
    to: "/devenir-benevole/profil"
    image: "/devenir-benevole/profil.svg"
  - title: Partager ses compΓ©tences
    description: DΓ©couvrez les diffΓ©rentes activitΓ©s dans lesquelles vous pouvez faire
      du bΓ©nΓ©volat et partagez votre expΓ©rience et votre Γ©nergie.
    to: "/devenir-benevole/activite"
    image: "/devenir-benevole/domaine.svg"
  - title: Rejoindre une association nationale
    description: Il existe forcΓ©ment une antenne locale d"une organisation nationale
      près de chez vous.
    to: "/reseau"
    external: true
    image: "/devenir-benevole/reseau.svg"

@farnabaz
Copy link
Member Author

farnabaz commented Dec 11, 2025

@maximepvrt This is even stranger that original issue. Do you mind monkey patch and add a log here to show the error trace and find the line?

logger.warn(`"${keyInCollection}" is ignored because parsing is failed. Error: ${e instanceof Error ? e.message : 'Unknown error'}`)

Also may I have access to repo? is it public?

@maximepvrt
Copy link
Contributor

@farnabaz I just sent you a DM on Discord regarding this.

@farnabaz farnabaz changed the title fix(module): work with nitro cache by registering routes before nitro… fix(module): work with nitro cache by registering routes before nitro config hook Dec 18, 2025
@farnabaz farnabaz changed the title fix(module): work with nitro cache by registering routes before nitro config hook fix(module): work with route rules cache: true Dec 18, 2025
@farnabaz farnabaz merged commit fa6c267 into main Dec 18, 2025
8 checks passed
@farnabaz farnabaz deleted the fix/nitro-cache branch December 18, 2025 14:25
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.

Nuxt Content API crashes when using Nitro multi-domain cache (varies)

3 participants