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

Avoid missing directory error when running dev #3224

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

joshuafredrickson
Copy link
Contributor

@joshuafredrickson joshuafredrickson commented Feb 6, 2025

When pulling down a fresh copy of Sage and running yarn && yarn dev, the following error occurs due to a missing public directory:

$ vite
node:fs:2426
    return binding.writeFileUtf8(
                   ^

Error: ENOENT: no such file or directory, open 'public/hot'
    at Object.writeFileSync (node:fs:2426:20)
    at Server.<anonymous> (file:///***/sage/wp-content/themes/sage/node_modules/laravel-vite-plugin/dist/index.js:110:14)
    at Object.onceWrapper (node:events:638:28)
    at Server.emit (node:events:536:35)
    at emitListeningNT (node:net:1980:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:89:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'public/hot'
}

This error doesn't occur if you happen to run yarn build before yarn dev. Adding an empty public directory to the repo alleviates this issue.

@joshuafredrickson joshuafredrickson changed the title Avoid missing folder error when running dev Avoid missing directory error when running dev Feb 6, 2025
Copy link
Member

@retlehs retlehs 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!

@retlehs retlehs merged commit b134d39 into roots:main Feb 27, 2025
3 checks passed
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.

2 participants