UPDATE: This has been resolved :white_check_mark: ...
# kvision
s
UPDATE: This has been resolved My final value became:
"../../../../webApp/build/processedResources/js/main"
Basically I had to add two more
../
and
webApp
to reach the root
build
folder/package Hey Folks I have just set up a KVision project and seeing this issue when running the
zip
gradle task
I also tried using the
preferRelative
property as suggested in the error message, but that only works when I run the project locally, it doesn't work when I use the
zip
gradle task
If it helps, I have just added this KVision project as a new module in my existing KMP project What things should I make sure for l18n to work properly in KVision? Another context, the project initialised the file structure to be like
com < garagegenie < project < App.kt
, and I reduced it down to
com < garagegenie < App.kt
. Could this have caused the issue?
r
Make sure you have the correct
webpack.js
file in your
webpack.config.d
folder. You also need
.gettext.json
. Compare the template project (https://github.com/rjaros/kvision-examples/tree/master/template)
s
Thank you Robert 🙌 I do have the .gettext.json file Thanks for the template, I'll compare
r
Your webApp module is not the root project, am I correct?
s
Correct
So the common gradle and the main build folder exist in the root package
r
Perhaps the first line of the webpack.js file should look like this:
config.resolve.modules.push("../../webApp/build/processedResources/js/main");
It should point to the correct folder in a submodule with a relative path, but the starting point is different (it's from <root>/build/js/packages/something) - please experiment a bit.
I think one more
../
could be required:
../../../webApp/build/processedResources/js/main
You could also try
require("./i18n/messages-pl.json")
instead in your code.
s
I did try the last one (it was suggested by the error message as well) but it didn't work But thank you for the other suggestions.. I'm hopeful of them.. I'll try those and update here as soon as I can Thanks for the help again 🙌
r
I think the relative require could work if you remove the first line from webpack.js completely.
As far as I remember I'm using it to be able to use simplified require calls:
img/...
i18n/...
The Kotlin plugin configuration and behavior changed a lot over the years, but the standard way is to use the relative paths with
./
prefix
s
You were right I just put in the absolute path and it worked Apparently the project generates 2
build
folders now 😆 one in the root package and one inside my
webApp
package Now I just need to figure out how to navigate from one
build
folder to another using relative paths 😂 which is the easier part So I think we can effectively call this thread resolved now I'll mark that in the initial message too, thank you for your time Robert!
Btw, is there some way using which I could configure my project to only use a single
build
folder for all code generation from all modules?
r
As far as I know the answer is no.
👍 1
s
No issues, thank you 🙂