igvteam / igv-webapp

IGV Web App
https://igv.org/app
MIT License
118 stars 44 forks source link

Failed to load module script: Expected a JavaScript module igv-widgets.js:1 #214

Closed feedlord18 closed 3 years ago

feedlord18 commented 3 years ago

I did a clean pull from master branch. Running on NPM 7.17.0 and node 12.18.4. Did the following:

  1. npm install
  2. npm run build All successful but when I run the server, I get this in Chrome console. "Failed to load module script: Expected a JavaScript module igv-widgets.js:1".

image

jrobinso commented 3 years ago

Sorry, run what server? How (how did you start it)? We don't provide a server.

feedlord18 commented 3 years ago

Sorry, I meant when I started the webapp.

jrobinso commented 3 years ago

Again, we don't provide a server. How did you "start" the webapp?

jrobinso commented 3 years ago

Ahh, I see, there is a "start" target in package.json. Apologies that shouldn't be there, its deprecated. You will need to provide your own server.

Can I assume you started it with. "npm run start"?

feedlord18 commented 3 years ago

We started it by "sudo http-server -p 72". It was used before and we didn't make any changes to it.

feedlord18 commented 3 years ago

It was created by the previous guy working on it and I'm trying to contact him right now. But it was working before.

jrobinso commented 3 years ago

You will need to install http-server yourself, its no longer in our package dependencies. See the http-server documentation for documentation, its not something we distribute, but you need to start it on the web content directory (the "dist" directory if you are building from source).

feedlord18 commented 3 years ago

So I did npm run start, and it is working on 8080. Probably an issue on out end. Sorry.

jrobinso commented 3 years ago

OK that will work for now, but again it was a mistake to even be there. We don't distribute http-server through igv-webapp anymore. For the future the equivalent of "npm run start" is below, your initial bug was caused by not including the "dist" directory (the content directory)

npx http-server -a localhost dist
feedlord18 commented 3 years ago

got it. Thank you!