-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Strapi exits on fs.writeFile() #7561
Comments
For this let me ping @petersg83 or @alexandrebodin as I'm not sure of the best case here, I believe in this case you are trying to edit another models lifecycles file correct? |
That is correct. I'm am attempting to dynamically create a model-js file which includes a lifecycle event for a plugin. |
The same error occurs when executing I've submitted a request for an update to allow |
I've since narrowed down the issue. Whether using |
the bug is coming because the server instance is not completely instantiated before the boostrap function runs. because you write files during the bootstrap, the watcher tries to reload and kill the server that is not created yet. |
Describe the bug
When writing new files to the system via
fs.writeFile()
, Strapi exits returning the following error:Steps to reproduce the behavior
strapi generate:plugin my-plugin
{my-plugin}/config/function/bootstrap.js
yarn develop
Expected behavior
File should be written to system without Strapi exiting.
System
The text was updated successfully, but these errors were encountered: