figwheel-main

kishima 2024-02-01T21:34:24.498209Z

Hello! How can I debug/check the server where figwheel-main loads js files? Not sure if that’s exactly the place where I should be looking, but that’s what seem to be happening. I’m running a few tests in the following alias:

:test-headless {:main-opts ["--main"         "figwheel.main"
                              "--compile-opts" "test-headless.cljs.edn"
                              "--main"         "test-runner-headless"]
                  :extra-deps {cljsjs/react {:mvn/version "17.0.2-0"}
                               cljsjs/react-dom {:mvn/version "17.0.2-0"}}}
But I’m getting the following error:
Launching Javascript environment with script:  js-test-env/start
Error: Could not load script: ""
    at onErrorWrapped (/Users/gustavokishima/backend/node_modules/jsdom/lib/jsdom/browser/resources/per-document-resource-loader.js:38:19)
    at Object.check (/Users/gustavokishima/backend/node_modules/jsdom/lib/jsdom/browser/resources/resource-queue.js:72:23)
    at /Users/gustavokishima/backend/node_modules/jsdom/lib/jsdom/browser/resources/resource-queue.js:83:27
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
  errno: -54,
  code: 'ECONNRESET',
  syscall: 'read'
}
It seems that the server is having trouble receiving js files. Sorry if this is not enough info and thanks in advance!

kishima 2024-02-01T21:37:03.957279Z

Also not sure if the question makes sense sorry

kishima 2024-02-01T22:24:22.965049Z

WELL for some random reason it worked now. The only different thing I did is that I reloaded the static server page on my browser and then it started working.

practicalli-johnny 2024-02-02T10:23:22.381189Z

Reloading the browser resets the state, so if there were stale symbols from the ClojureScript code or other changes, then they will have been cleared and reloaded from scratch.

kishima 2024-02-02T15:00:48.330169Z

Is there a way to find out about why I have to do this, though? I noticed it’s consistent: whenever I update the browser on this page, this works.

practicalli-johnny 2024-02-02T15:14:12.963459Z

I usually experience this when there are bugs in my code, where it fails to compile. There are dev tools for browsers that can be useful above any issues that figwheel itself catches. Source mas can also be useful or showing which ClojureScript code may be the cause. I have some links for dev tools, most should be okay, although I have done this for a while https://practical.li/clojurescript/install/browser-devtools/