scratchfoundation / scratchfoundation/scratch-editor

The “fetch-worker” file failed to load correctly.

Open
#410 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
283
Forks
276
Avg merge
7d 8h
Merged PRs (30d)
6

Description

Expected Behavior

Expect to modify the publicPath configuration in webpack to not be set to “auto”. For example, setting it to “/scratchnew” should correctly load the “fetch-worker” file, enabling the addition of roles img to load properly onto the stage.

Steps to Reproduce

Expect ur : http://localhost:8601/scratchnew/

  1. file: packages/scratch-gui/webpack.config.js
output: {
           publicPath: '/scratchnew/', 
           path: path.resolve(__dirname, 'dist')
       }
  1. view NetWork find http://localhost:8601/chunks/fetch-worker.xxxx.js is not right, but http://localhost:8601/scratchnew/gui.js is ok

  2. when Select Sprite but roles image is not load onto stage。 packages/scratch-gui/src/containers/target-pane.jsx==> this.props.vm.setEditingTarget(id)) is ok。
    packages/scratch-vm/src/virtual-machine.js ==> installTargets is ok.
    packages/scratch-vm/src/serialization/sb3.js is ok,
    but packages/scratch-storage is not work.

  3. When I use Nginx to forward requests to http://localhost:8601/chunks/fetch-worker.xxxx.js, it works fine. The roles img to can loaded onto the stage.

  4. Is it possible that the fetch-worker file cannot be modified by the webpack tool to change its access path?
    No matter how I adjust the packaging location of ‘scratch-storage/dist/web’. Even after adjusting assetModuleFilename: 'static/assets/[name].[hash][ext][query], assetHost: window.location.origin + "/scratchnew, and other methods, fetch-worker.js within scratch-storage still fails to load and function correctly. Does scratch-storage have specific requirements for loading fetch-worker?

  5. I was hoping to modify the publicPath to handle subdomains, avoiding direct access from the root /. Do you have any other good solutions? If so, please let me know. Thank you very much.

Thank you very much.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue at http://localhost:8601/scratchnew/ and inspect the Network request for chunks/fetch-worker.xxxx.js. Start with packages/scratch-gui/webpack.config.js, then compare the loading behavior with packages/scratch-storage and the referenced target-pane.jsx and serialization/sb3.js paths. Done means fetch-worker loads correctly under the configured subpath without Nginx forwarding, and roles images load onto the stage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, webpack
Domain
build-system, frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.