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

hook 'content:file:beforeParse' not working #2744

Open
editcue opened this issue Aug 5, 2024 · 2 comments
Open

hook 'content:file:beforeParse' not working #2744

editcue opened this issue Aug 5, 2024 · 2 comments

Comments

@editcue
Copy link

editcue commented Aug 5, 2024

Environment

Nuxt 3.12.4
Nitro 2.9.7

Reproduction

use official project starter command
npx nuxi@latest init content-app -t content
and add a plugin into path:/server/plugins like this

export default defineNitroPlugin((nitroApp) => {
	console.log('nitroApp defineNitroPlugin')
	nitroApp.hooks.hook('content:file:beforeParse', (file) => {
		console.log('nitroApp content:file:beforeParse')
		if (file._id.endsWith('.md')) {
			file.body = file.body.replace(/react/g, 'vue')
		}
	})
})

Describe the bug

When nuxt version is 3.12.4,it did not run into console.log('nitroApp content:file:beforeParse') and print.
When I down grade nuxt to 3.12.2. It work fine.

Additional context

No response

Logs

No response

@editcue editcue changed the title content:file:beforeParse hook not working hook 'content:file:beforeParse' not working Aug 5, 2024
Copy link

github-actions bot commented Oct 5, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Oct 5, 2024
@AloisSeckar
Copy link
Sponsor

I experience the same problem using version 2.13.2

@github-actions github-actions bot removed the Stale label Oct 6, 2024
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

No branches or pull requests

2 participants