Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uncaught typeerror: env was a bare specifier #66

Open
syamajala opened this issue Oct 11, 2024 · 6 comments
Open

uncaught typeerror: env was a bare specifier #66

syamajala opened this issue Oct 11, 2024 · 6 comments

Comments

@syamajala
Copy link
Contributor

I deployed a copy of the viewer here:
https://s3df.slac.stanford.edu/people/seshu/prof-viewer/

When I try to view a profile:
https://s3df.slac.stanford.edu/people/seshu/prof-viewer/?url=https://s3df.slac.stanford.edu/people/seshu/legion_prof.2

Im seeing this in the console:

Uncaught TypeError: The specifier “env” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.

I ran this command to build the viewer:

trunk build --release --public-url https://s3df.slac.stanford.edu/people/seshu/prof-viewer/
@elliottslaughter
Copy link
Contributor

I believe that if the URL you are deploying to is https://s3df.slac.stanford.edu/people/seshu/prof-viewer/ then the correct flag is --public-url people/seshu/prof-viewer, i.e., relative not absolute.

@elliottslaughter
Copy link
Contributor

You can see an example command in: https://github.com/StanfordLegion/prof-viewer/actions/runs/11278437187/job/31366883028

The variable GITHUB_REPOSITORY expands from: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables

And the # shell replacement pattern is documented at: https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html

So I think our main repo builds with --public-url prof-viewer because we deploy to https://legion.stanford.edu/prof-viewer/.

@syamajala
Copy link
Contributor Author

It seems like its getting confused?

Uncaught TypeError: The specifier “people/seshu/prof-viewer/legion_prof_viewer-83e259d51965769d.js” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”. prof-viewer:14:33
XHRGET
https://s3df.slac.stanford.edu/people/seshu/prof-viewer/people/seshu/prof-viewer/people/seshu/prof-viewer/legion_prof_viewer-83e259d51965769d_bg.wasm
[HTTP/1.1 404 Not Found 157ms]

GET
https://s3df.slac.stanford.edu/people/seshu/prof-viewer/people/seshu/prof-viewer/people/seshu/prof-viewer/legion_prof_viewer-83e259d51965769d.js
NS_ERROR_CORRUPTED_CONTENT

Loading module from “https://s3df.slac.stanford.edu/people/seshu/prof-viewer/people/seshu/prof-viewer/people/seshu/prof-viewer/legion_prof_viewer-83e259d51965769d.js” was blocked because of a disallowed MIME type (“text/html”). prof-viewer
None of the “sha384” hashes in the integrity attribute match the content of the subresource. The computed hash is “OLBgp1GsljhM2TJ+sbHjaiH9txEUvgdDTAzHv2P24donTt6/529l+9Ua0vFImLlb”. prof-viewer
GET
https://s3df.slac.stanford.edu/people/seshu/prof-viewer/people/seshu/prof-viewer/people/seshu/prof-viewer/favicon-f402c8741ce815ec.ico
[HTTP/1.1 404 Not Found 0ms]

GET
https://s3df.slac.stanford.edu/people/seshu/prof-viewer/people/seshu/prof-viewer/icon_ios_touch_192.png
[HTTP/1.1 404 Not Found 0ms]

Uncaught (in promise) TypeError: ServiceWorker script at https://s3df.slac.stanford.edu/people/seshu/prof-viewer/people/seshu/prof-viewer/sw.js for scope https://s3df.slac.stanford.edu/people/seshu/prof-viewer/people/seshu/prof-viewer/ encountered an error during installation.
The resource at “https://s3df.slac.stanford.edu/people/seshu/prof-viewer/people/seshu/prof-viewer/people/seshu/prof-viewer/legion_prof_viewer-83e259d51965769d_bg.wasm” preloaded with link preload was not used within a few seconds. Make sure all attributes of the preload tag are set correctly. prof-viewer

Not sure why its looking for stuff in people/seshu/prof-viewer/people/seshu/prof-viewer when I do: trunk build --release --public-url people/seshu/prof-viewer

@syamajala
Copy link
Contributor Author

Mabye i should do a clean build.

@syamajala
Copy link
Contributor Author

A clean build didn't help.

@elliottslaughter
Copy link
Contributor

elliottslaughter commented Oct 12, 2024

You need to use exactly Trunk v0.18.8. You can get it online here for Linux (if your distro is new enough): https://github.com/trunk-rs/trunk/releases/download/v0.18.8/trunk-x86_64-unknown-linux-gnu.tar.gz

Or you can install it by hand:

cargo install --version 0.18.8 --locked trunk

I used this to deploy a viewer to https://sapling2.stanford.edu/~eslaught/prof-viewer/, but I can't test it without any sufficiently new enough profiles to run on. For posterity the command for this deployment was:

trunk build --release --public-url '~eslaught/prof-viewer'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants