Difference between build and build-hot

I have made an edit to the metabase frontend, I want to run ./bin/build. This runs yarn build to generate my assets. However when I view it in my browser, I don’t see my changes. I only see the changes when I run yarn build-hot. This is not helpful as I really need to bundle the build so I deploy.
What can I be getting wrong. How do I properly run the build

Hi @VanPaitin
You use ./bin/build to build Metabase - meaning it creates a JAR-file with everything.
But while you’re working, you want to have these two commands running, since you want to see changes instantly: yarn run build-hot and lein ring server
There’s a bit more context in the documentation: https://metabase.com/docs/latest/developers-guide.html

Hi @flamber

Sorry if I was not very clear. The build runs everything successfully. I have finished making the change. However when I run the generated jar file in target/uberjar, I can’t find my new changes. It is still as if I ran build before the change

Hmm… I have never had that problem, but I rarely build, usually just build-hot.

Which version of Java? java -version

What files did you modify, something in ./frontend/...? Can you open the JAR-file and check if files you changed are included (it’s just a ZIP archive)?

So if you run yarn run build-hot right now, you can still see your changes?

java version "1.8.0_171" Java(TM) SE Runtime Environment (build 1.8.0_171-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

Yeah, I modified something in ./frontend/metabase/.... I will check the jar file now.

When I run build-hot, I still see the changes

Slightly outdated Java, but that shouldn’t be the problem here.
I have a feeling that something is cached and needs to be cleaned. Have you tried removing the ./target/ directory?
Just to make sure, are you running build-hot, while also trying to build? I’m not sure how it behaves, so try shutting down the test environment before building.

Thanks for your help @flamber

So what happened was that we were using a cdn as webpack’s public path. I forgot to update the cdn, so it was using the stale assets. Thanks for your time

1 Like