Fix Vite HMR Server Restart (#20617)

This commit is contained in:
Jean-Sébastien Herbaux 2024-06-25 14:56:54 +02:00 committed by GitHub
parent 4e90afaca7
commit ee2f2d6535
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 4 additions and 6 deletions

View File

@ -5,8 +5,6 @@ const config = {
locales: ['it', 'es', 'en'], locales: ['it', 'es', 'en'],
}; };
const bootstrap = (app) => { const bootstrap = (app) => {
console.log('I AM BOOTSTRAPPED');
app.getPlugin('content-manager').injectComponent('editView', 'right-links', { app.getPlugin('content-manager').injectComponent('editView', 'right-links', {
name: 'PreviewButton', name: 'PreviewButton',
Component: () => ( Component: () => (

View File

@ -613,7 +613,7 @@
"components.InputSelect.option.placeholder": "Choose here", "components.InputSelect.option.placeholder": "Choose here",
"components.ListRow.empty": "There is no data to be shown.", "components.ListRow.empty": "There is no data to be shown.",
"components.NotAllowedInput.text": "No permissions to see this field", "components.NotAllowedInput.text": "No permissions to see this field",
"components.OverlayBlocker.description": "You're using a feature that needs the server to restart. Please wait until the server is up.", "components.OverlayBlocker.description": "You're using a feature that needs the server to restart. The page will reload automatically.",
"components.OverlayBlocker.description.serverError": "The server should have restarted, please check your logs in the terminal.", "components.OverlayBlocker.description.serverError": "The server should have restarted, please check your logs in the terminal.",
"components.OverlayBlocker.title": "Waiting for restart...", "components.OverlayBlocker.title": "Waiting for restart...",
"components.OverlayBlocker.title.serverError": "The restart is taking longer than expected", "components.OverlayBlocker.title.serverError": "The restart is taking longer than expected",

View File

@ -77,7 +77,7 @@ const AutoReloadOverlayBlockerProvider = ({ children }: AutoReloadOverlayBlocker
let description = { let description = {
id: config?.description || 'components.OverlayBlocker.description', id: config?.description || 'components.OverlayBlocker.description',
defaultMessage: defaultMessage:
"You're using a feature that needs the server to restart. Please wait until the server is up.", "You're using a feature that needs the server to restart. The page will reload automatically.",
}; };
let title = { let title = {

View File

@ -527,7 +527,7 @@ export const FormModal = () => {
if (canEditContentType(allDataSchema, modifiedData)) { if (canEditContentType(allDataSchema, modifiedData)) {
onCloseModal(); onCloseModal();
submitData(modifiedData); await submitData(modifiedData);
} else { } else {
toggleNotification({ toggleNotification({
type: 'danger', type: 'danger',

View File

@ -87,7 +87,7 @@ const resolveDevelopmentConfig = async (ctx: BuildContext): Promise<InlineConfig
server: { server: {
middlewareMode: true, middlewareMode: true,
open: ctx.options.open, open: ctx.options.open,
hmr: true, hmr: { server: ctx.strapi.server.httpServer },
}, },
appType: 'custom', appType: 'custom',
}; };