WorldWideTelescope / wwt-web-client

The WorldWide Telescope web client lets you explore the universe in your browser.
https://worldwidetelescope.org/webclient/
MIT License
105 stars 35 forks source link

should I be worried about these pako/uuid promise errors in my console #350

Closed DougBurke closed 2 years ago

DougBurke commented 2 years ago

My console log - from https://cxc.harvard.edu/csc2/wwt.html - starts with the following. I am ignoring this, but thought I'd mention it

wwtsdk.js:48255 Uncaught (in promise) TypeError: Failed to resolve module specifier 'pako'. The base URL is about:blank because import() is called from a CORS-cross-origin script.
    at wwtsdk.js:48255:5
    at define (wwtsdk.js:1547:21)
    at wwtsdk.js:1557:1
    at wwtsdk.js:17:19
    at wwtsdk.js:19:2
(anonymous) @ wwtsdk.js:48255
define @ wwtsdk.js:1547
(anonymous) @ wwtsdk.js:1557
(anonymous) @ wwtsdk.js:17
(anonymous) @ wwtsdk.js:19
Promise.then (async)
(anonymous) @ wwtsdk.js:48255
define @ wwtsdk.js:1547
(anonymous) @ wwtsdk.js:1557
(anonymous) @ wwtsdk.js:17
(anonymous) @ wwtsdk.js:19
wwtsdk.js:48261 Uncaught (in promise) TypeError: Failed to resolve module specifier 'uuid'. The base URL is about:blank because import() is called from a CORS-cross-origin script.
    at wwtsdk.js:48261:5
    at define (wwtsdk.js:1547:21)
    at wwtsdk.js:1557:1
    at wwtsdk.js:17:19
    at wwtsdk.js:19:2
pkgw commented 2 years ago

Hey Doug — these messages shouldn't affect your application, but you should also be able to make them go away.

For a long time, the WebGL engine has had a hackily shimmed-in dependency on the "pako" library to do (de)compression of WWT CSV data payloads. We recently figure out a way to make it a bit more formalized (WorldWideTelescope/wwt-webgl-engine#170) and I think that's causing the new messages. More recently we used the same scheme to add a dep on the "uuid" library to fix up some issues relating to HiPS progressive catalog data.

If you're not using npm package management, you should be able to make things happy by adding a couple of manual script imports before the wwtsdk import — see the code changes in #349 in this repo for an example.

As it stands, your app would fail if it hit the codepaths that involved those dependencies, but they both apply to pieces of the engine that I don't think can even be accessed from your app.

DougBurke commented 2 years ago

This application is definitely not doing anything remotely fancy, like using npm ! I'll add the script imports to make things clean and then report back (depending on my about-to-start-meeting this may be today or may be in n days).

pkgw commented 2 years ago

I'm not sure if we can still call npm "fancy" in 2022 ... but anyway I'm pretty sure it should be a two-line change to make the warnings go away.

DougBurke commented 2 years ago

Looks like my issues have gone away with the imports.