Skip to content

Deployment on different servers not working #19330

@javialon26

Description

@javialon26

Bug report

Required System information

Launched In: 166 ms
Environment: development
OS: darwin-arm64
Strapi Version: 4.19.0
Node/Yarn Version: npm/10.2.3 node/v20.10.0 darwin arm64 workspaces/false
Edition: Community
Database: sqlite

Describe the bug

I'm following the deployment guide for different servers (I want to deploy the admin panel - react app - to Netlify and the server to a droplet or similar). Still, the generated index.html file contains invalid paths to the generated js files.

Steps to reproduce the behavior

  1. Create a Strapi example project using the quick start guide - https://docs.strapi.io/dev-docs/quick-start
  2. Configure the server.js and admin.js files as described in the different server configuration guide - https://docs.strapi.io/dev-docs/admin-panel-customization#different-servers
  3. Run NODE_ENV=production npm run build
  4. The generated paths to the js files contain an extra slash, generating 404 errors:

src="//runtime~main.35ff75f1.js"
src="//main.19186bea.js"

Expected behavior

Create the index.html with the correct paths with only one slash to access the admin site using the http://yourfrontend.com URL. I think in this context the proxy recommendation not apply because this is a front-end app with the index.html file and js files, must work with any static hosting provider.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: EEIssues correlates to internal EE ticketissue: bugIssue reporting a bugseverity: highIf it breaks the basic use of the productsource: core:strapiSource is core/strapi packagestatus: confirmedConfirmed by a Strapi Team member or multiple community membersversion: 4Issue is present in Strapi v4

    Type

    No type

    Projects

    Status

    Fixed/Shipped

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions