3

When I restart strapi, I can no longer edit content, receiving this alert:

The autoreload feature is required to use this plugin. 
Start your server with strapi develop

3 Answers 3

1

To solve the right problem, I'd need more detail, however, I was running into the same issue while using yarn start. Instead, I used yarn strapi dev, which ran strapi with the correct configuration.

I am able to run the server and edit content; however, I initially tried changing the production and staging server.json files to include the following, but this did not work.

"autoReload": {
  "enabled": true
},
1

I had same issue. I fixed it by running npx strapi dev.

In the development process of your project, in order to customize (add/remove/modify) content of your API, you need to start the server in a dev mode, which is done through npx strapi dev. There is a whole command line manual on here.

4
  • Welcome on the SU! Thanks the answer. Could you please elaborate it?
    – peterh
    May 8, 2020 at 20:48
  • You're welcome. Well in dev. process of your project, in order to customize(add/remove/modify) content of your API, you need to start the server in a dev. mode which is done through npx strapi dev. there is a whole command line manual on strapi.io/documentation/3.0.0-beta.x/cli/… May 9, 2020 at 21:26
  • Edit it into the answer (click "edit"). The important thing is, the answers should be comprehensible even without the comments. The goal is to create a clear question / clear answer(s) pairs for the visitors of the google.
    – peterh
    May 9, 2020 at 21:33
  • ...roughly so. :-) We have also a lot of formatting options. If your answer is a good one, you will get upvotes, here is your first one. :-)
    – peterh
    May 9, 2020 at 21:35
0

When I started using Strapi, I believed that I could create/edit/delete content types in production. BUT THIS IS NOT POSSIBLE.

Notes from Strapi:


### Why can't I create or update content-types in production/staging?

Strapi stores model configuration files (what defines the model schema) in files such as `api/restaurant/models/restaurant.settings.json`. Due to how Node.js works, in order for changes to take effect, that would require Node to restart the server. This could potentionally cause downtime of your production service and likewise these changes should be tracked in some kind of source control.

Generally your "flow" of development would follow the following path:

- Development - Develop your Strapi application locally on your host machine, then push changes into source control
- Staging - Deploy changes from source control to a "production-like" environment for testing
- Production - If no other changes are needed, deploy into production
- Repeat as needed, it is recommended that you properly version and test your application as you go

At this time and in the future there is no plan to allow model creating or updating while in a production environment, and there is currently no plans to move model settings into the database. There is no known nor recommended workarounds for this.

What Should I do

You need to create schema locally in development mode npm run develop. Then you have to commit the repo (which will have schema under src/api folder) to Git repo. In your production, you have to pull the repo and run it as

NODE_ENV=production npm run start

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .