Skip to content

Conversation

yokobond
Copy link

Resolves

Fixes issue where fetch-worker.* files are placed in root-level https://<server>/chunks/ when scratch-editor is deployed to a non-root path, causing worker loading failures.

Proposed Changes

This Pull Request modifies the webpack configuration to use relative paths for chunk loading instead of absolute paths. The key change is setting publicPath: 'auto' in the webpack configuration, which ensures that:

  • Worker files (fetch-worker.*) are loaded relative to the deployed application path
  • Chunks are properly resolved when scratch-editor is deployed to subdirectories
  • The application works correctly regardless of deployment path

Reason for Changes

When scratch-editor is deployed to a non-root path (e.g., https://example.com/my-app/), the current configuration places worker chunks at the server root (https://example.com/chunks/) instead of relative to the application (https://example.com/my-app/chunks/). This causes:

  • 404 errors when trying to load worker files
  • Application failures in subdirectory deployments
  • Deployment flexibility issues

By using relative paths, the worker files will be correctly located relative to where the main application is deployed, ensuring compatibility with various deployment scenarios.

@yokobond yokobond marked this pull request as ready for review August 15, 2025 10:57
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.

1 participant