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: use serverDir instead of srcDir for new Nuxt 4 file structure #66

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

blqke
Copy link
Contributor

@blqke blqke commented Jul 18, 2024

Nuxt 4 introduces a new default directory structure

With this new structure enabled on a Nuxt 3 project using the following configuration:

future: {
  compatibilityVersion: 4,
}

This module is not working anymore, because the module resolve cron directory to <srcDir> which is app/ by default, and therefore tries to resolve
app/server/cron/ by default, and not server/cron/,

Check it here -> https://stackblitz.com/edit/github-hessqh?file=src/module.ts

I believe it should try to resolve <serverDir>, which by default is <rootDir>/server when compatibilityVersion: is set to 4, and <srcDir>/server otherwise.

I believe there is no breaking change for those who havent migrated to the new structure.

@hywax-assistant
Copy link
Collaborator

👋 @blqke

💖 Thanks for opening this pull request!

Please follow the contributing guidelines. And we use semantic commit messages to streamline the release process.

Examples of commit messages with semantic prefixes:

  • fix: interval for sending a request in the base service
  • feat: add new NAME service
  • docs: example of using the NAME service

If you like this project, please ⭐ star our repo.

@hywax
Copy link
Owner

hywax commented Jul 18, 2024

Hi, I saw that nuxt changed the structure. Thank you for your PR. I will do a merge of your commit shortly

@hywax hywax added the feature request Suggest an idea for future development label Jul 18, 2024
@hywax hywax merged commit 4e8a9d9 into hywax:main Jul 18, 2024
1 of 4 checks passed
@hywax-assistant
Copy link
Collaborator

👋 @blqke Congrats on merging your first pull request! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Suggest an idea for future development
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants