cpsdqs / prechoster

cohost.org post preprocessor. it’s for posting on cohost.org. cohost.org posting. with css. dangerous css posting. you can be making a post that is so cascaded. in a style sheets way. advanced posting on a website online. you can use web technologies in a web browser. to make posts. posting online right now today. lol how long can i make this descr
https://cloudwithlightning.net/random/chostin/prechoster/
MIT License
64 stars 7 forks source link

Svelte renderer errors due to issues forming worker URL #5

Closed lpalombo closed 1 year ago

lpalombo commented 1 year ago

image

Experienced the same issue on:

VM6560:139 Uncaught Error: React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build
    at <anonymous>:139:17
(anonymous) @   VM6560:139
setTimeout (async)      
checkDCE    @   VM6560:138
e   @   reactflow-35b5827d.js:50
(anonymous) @   reactflow-35b5827d.js:50
(anonymous) @   reactflow-35b5827d.js:50
svelte-worker-6d88113b.js:1161

TypeError: Failed to construct 'URL': Invalid URL
    at Object.resolveId (svelte-worker-6d88113b.js:1161:473383)
    at svelte-worker-6d88113b.js:1161:376376
(anonymous) @   svelte-worker-6d88113b.js:1161
Promise.catch (async)       
(anonymous) @   svelte-worker-6d88113b.js:1161
react_devtools_backend.js:4026

Error: TypeError: Failed to construct 'URL': Invalid URL
    at Worker.i (svelte-a533a19d.js:formatted:81:79)
overrideMethod  @   react_devtools_backend.js:4026
eval    @   index.js:formatted:672
await in eval (async)       
renderPreview   @   index.js:formatted:28438
await in renderPreview (async)      
componentDidMount   @   index.js:formatted:28409
(anonymous) @   index.js:formatted:309
(anonymous) @   index.js:formatted:308
C   @   index.js:formatted:304
(anonymous) @   index.js:formatted:28678
(anonymous) @   index.js:formatted:28679
Promise.then (async)        
(anonymous) @   index.js:formatted:28659

I also gave https://pr.new/github.com/cpsdqs/prechoster a shot and ran it with npm run watch and saw the same issues, thinking maybe it had to do with dev environment discrepancies.

Looks like this has something to do with how Urls are getting sent to svelte-worker.js?

lpalombo commented 1 year ago

thank you for making this tool btw!!!!!!!!!

cpsdqs commented 1 year ago

that’s really weird. cannot reproduce in safari. can reproduce in chrome (i didn’t test prechoster in chrome ever………). it seems new URL(anything, 'lib:///') fails because chrome’s URL implementation is bad. fixed by including a spec-compliant polyfill