You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> npx parcel serve src/index.html
Server running at http://localhost:1234
✨ Built in 11ms
The web browser I'm using is Chrome version 103.0.5060.13 on Windows 10 64-bit. Opening the Chrome console shows this error:
TypeError: Y.startsWith is not a function
at L (worker.7fe67360.js:720:18)
at worker.7fe67360.js:2413:73
at n (worker.7fe67360.js:2420:6)
at async worker.7fe67360.js:2491:41
Attached file: worker.7fe67360.js.txt. It is the contents of node_modules/@aduh95/viz.js/dist/render.browser.js with some stuff added by Parcel.
When you edit render.browser.js, the Parcel web server will automatically re-build, then you need to refresh the page in Chrome.
The L function is called twice:
The first time L is called, Y is the string "render.wasm".
The second time L is called, Y is a URL object, and Y.toString() returns "http://localhost:1234/render.fc4f61f3.wasm?1659397387600". URL objects do not have a startsWith method!
Did you try to change your locateFile to return String(wasmURL)? I wonder if that would be an easier workaround than changing the emscripten generated file.
Is this a bug in Emscripten??
It could be, it's one of their function, and it looks like it could be improved by adding URL support.
Hi, I'm trying to use viz.js in a web browser using the Parcel bundler.
Directory structure of my test project:
Contents of file package.json:
Contents of file index.html:
The Parcel bundler does not support package.json#exports and does not have a file-loader plugin. So the main.js and worker.js files are both taken from https://github.com/aduh95/viz.js/blob/master/README.md#using-a-bundler.
Contents of file main.js:
Contents of file worker.js:
Running Parcel and starting a web server:
The web browser I'm using is Chrome version 103.0.5060.13 on Windows 10 64-bit. Opening the Chrome console shows this error:
Attached file: worker.7fe67360.js.txt. It is the contents of
node_modules/@aduh95/viz.js/dist/render.browser.js
with some stuff added by Parcel.Here's the code where the error happens:
Here's what happening at the second stack frame:
I debug this issue, I edited render.browser.js to add a
debugger
statement before the error happens to see what's happening:When you edit render.browser.js, the Parcel web server will automatically re-build, then you need to refresh the page in Chrome.
The
L
function is called twice:L
is called,Y
is the string"render.wasm"
.L
is called,Y
is aURL
object, andY.toString()
returns"http://localhost:1234/render.fc4f61f3.wasm?1659397387600"
. URL objects do not have astartsWith
method!If I edit render.browser.js to have:
Then everything works correctly, and the Chrome console shows an SVG XML file as a string.
Is this a bug in Emscripten??
The text was updated successfully, but these errors were encountered: