@novu/shared tweaks
Guys, I noticed a problem with the
getContextPath
function in the @novu/shared
library. Back in version 0.12 I just tweaked that file with the required changes and completed a docker build and everything worked. Happy days. However, I have jumped to Novu version 0.16 and the same fix no longer works. In fact it appears that the tweaks version is no getting included in the build at all!
Before, with version 0.12, my tweaked code was getting included in the resulting build/static/js/main.xxx.js
file (and map file). However now, the code that is included is the same code from the original Novu repo (not my tweaks code) which is no longer present in my local repo / env when I am building the docker image! One other item to note, is that I do not change the version number of the @novu/shared
library in my local repo, I keep everything the same as before
Is the @novu/shared
library that is getting included in my docker build getting pulled from the internet and not getting build locally?9 Replies
@dmulligan
Are you using this documentation for deployment?
https://docs.novu.co/overview/docker-deploy
I have read that document, and it is light on information regarding the issues at hand. We have our own customer GitHub Actions for building each of the different container images, and they are heavily based on Novu's own dev-deploy-* / prod-deploy-* GitHub actions. For instance, the building of the WEB image uses the following command which is based on https://github.com/novuhq/novu/blob/next/.github/workflows/prod-deploy-web.yml#L205-L219 with the exception that we are using
docker buildx
directly on not depot
The building of the docker container triggers the building of the Novu web application via apps/web/Dockerfile
My guess is that something within the build system is not rebuilding the local version of @novu/shared
and instead fetching the already built instance from a shared cached on the internet. However, I do not have much knowledge on NX Cloud which is called via "build:web": "nx build @novu/web"
@dimagrossman Can you please here?
@dmulligan can you please share the package.json contents of your web project?
Thanks for your message @dimagrossman the web package.json file is an exact match to https://github.com/novuhq/novu/blob/v0.16.1/apps/web/package.json
GitHub
novu/apps/web/package.json at v0.16.1 · novuhq/novu
The open-source notification infrastructure with fully functional embedded notification center - novuhq/novu
And in the @Novu/shared package, what version is specified there?
it should be the exact same version as specified in the package json files of the other used packages, otherwise it will fetch from npm
GitHub
novu/libs/shared/package.json at v0.16.1 · novuhq/novu
The open-source notification infrastructure with fully functional embedded notification center - novuhq/novu
Can you try updating the @Novu/shared version to be exact match without the "^" to be 0.16.1?
It might be fetching the latest 0.16.4 from npm
I added the following to
apps/web/Dockerfile
And within the created web container, I ran the following commands. You can see that @novu/shared
is getting built correctly, but a different copy of Novu shared is included within the web's copy of node_modules
I will try as you suggested next
That worked, once the version is locked, it will use the local version of @novu/shared
. A huge thank you for that information.
FYI, I have shared the fix back as a PR https://github.com/novuhq/novu/pull/3814