GMOD / jbrowse

JBrowse 1, a full-featured genome browser built with JavaScript and HTML5. For JBrowse 2, see https://github.com/GMOD/jbrowse-components.
http://jbrowse.org
Other
464 stars 199 forks source link

embedded, minified, "standalone" JBrowse doesn't work #1238

Closed garrettjstevens closed 6 years ago

garrettjstevens commented 6 years ago

Data: jbrowse_embed_test.tar.gz

To reproduce:

wget https://github.com/GMOD/jbrowse/files/2507329/jbrowse_embed_test.tar.gz
tar xvzf jbrowse_embed_test.tar.gz
rm jbrowse_embed_test.tar.gz
cd jbrowse_embed_test/
git clone https://github.com/GMOD/jbrowse.git
cd jbrowse/
git checkout embedded_build
yarn
JBROWSE_PUBLIC_PATH=/jbrowse/dist/ JBROWSE_BUILD_MIN=0 ./setup.sh
cd ..
jbrowse/utils/jb_run.js

If you go to http://localhost:3000/ you should see links to normal JBrowse, embedded main entrypoint (main.bundle.js), and embedded standalone entrypoint (browser.bundle.js). They all should work. Then stop the process, run:

cd jbrowse/
JBROWSE_PUBLIC_PATH=/jbrowse/dist/ JBROWSE_BUILD_MIN=1 ./setup.sh
cd ..
jbrowse/utils/jb_run.js

and refresh, and now the standalone one gives an error about not being able to find JBrowse/ConfigAdaptor/JB_json_v1.

I found out that if you "require" JBrowse/ConfigAdaptor/JB_json_v1 in standalone.js, that error goes away, but then you get an error that it can't find JBrowse/ConfigAdaptor/conf. If you require that, too, it gives an error that it can't find one of the plugins. So it seems to be a problem with dynamically imported modules.

I'm not sure why the embedded main entrypoint one works fine. Obviously those modules are there somewhere, the standalone entrypoint just can't find them.

I've tried messing with webpack.config.js and dojo-loader-config.js to get it to be able to find those modules, but no luck so far.

garrettjstevens commented 6 years ago

The problem was staring me in the face and I didn't see it. standalone.js wasn't on the list of files that glob-loader.js dynamically adds all the modules to. Pushing a fix soon.