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: refresh content-index on nitro start #1947

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

Barbapapazes
Copy link
Contributor

@Barbapapazes Barbapapazes commented Mar 5, 2023

πŸ”— Linked issue

fix #1869

❓ 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

Here the situation:

This situation also occure when you pull from remote with new files in the content folder with a stopped dev server.

Here, I remove the content-index.json file every time nitro restart to be sure that a fresh index is generated before the user restart to code.

I was thinking about using a hash but I didn't find good data to hash and this could require to check each time the user hit save. With this method (removing index when nitro start), index is re-caculated only once.

πŸ“ Checklist

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

@codesandbox
Copy link

codesandbox bot commented Mar 5, 2023

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Mar 5, 2023

βœ… Deploy Preview for nuxt-content canceled.

Built without sensitive environment variables

Name Link
πŸ”¨ Latest commit 83895b2
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt-content/deploys/640485b003a52400089c97d9

@atinux atinux requested a review from farnabaz March 5, 2023 11:59
@atinux
Copy link
Member

atinux commented Mar 5, 2023

Nice one, I indeed had this bug as well. I let @farnabaz review since he worked on the content index

@Barbapapazes Barbapapazes force-pushed the fix-module-content-index branch from 79c58a3 to 83895b2 Compare March 5, 2023 12:06
Copy link
Member

@farnabaz farnabaz left a comment

Choose a reason for hiding this comment

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

LGTM πŸ‘

@farnabaz farnabaz merged commit e1506ed into nuxt:main Mar 6, 2023
@farnabaz farnabaz mentioned this pull request Mar 8, 2023
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.

Need to add a hash to content-index.json
3 participants