Skip to content

[BUG] Toggling code editor fails on current development build #203

Description

@hobbsythe6th

Describe the bug
If you start up a new dev server (or load up https://candlestickers.app/test/), and open the code editor, you get this console error:
Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:3000/static/js/worker-javascript.js' failed to load.
(anonymous) @ index.js:35
(anonymous) @ index.js:35
(anonymous) @ Editor.jsx:217
Editor.jsx:218 Error Details: {error: "Uncaught NetworkError: Failed to execute 'importSc…0/static/js/worker-javascript.js' failed to load.", url: 'blob:http://localhost:3000/16c863ac-f036-47c3-bdfc-cc44a9451e3b', line: 1}

note: line numbers may be a bit off, but Editor.jsx:217 is window.onerror = function (error, url, line) {/*...*/} in the constructor and index.js:35 is ReactDOM.render(\<Editor \/\>)

To reproduce
Steps to reproduce the behavior:

  1. Make sure you are running the test build
  2. Open the code editor
  3. See error in console

Expected behavior
Code editor toggles cleanly.

Editor version
Candlestick only, on the development branch

Device

  • Lenovo AIO Desktop
  • Windows 11
  • Microsoft Edge

Do you have a suggested solution to this issue?
I fixed it in my Rolldown migration PR by doing: ace.config.set('basePath', import.meta.env.VITE_PUBLIC_URL + 'ace-workers/'); in WickCodeEditor.jsx and also adding "copy-ace-workers": "shx mkdir -p public/ace-workers && shx cp node_modules/ace-builds/src-noconflict/worker-javascript.js public/ace-workers/worker-javascript.js" as a script in package.json

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions