OWA Yeoman Generator Webpack Error

Hello, I have been trying to use this release (webpack) to generate an owa and install it to refapp 2.5 but it seems that it does not generated the necessary files to correctly install it. I tried both build:deploy and build:production.

build deploy copied the webpack files to the owa directory but app structure was not there. same thing for the zip file generated.

In either case, the app did not show up in the owa app management screen. Am is missing something?

Thanks, Tim

I’m not clear on exactly what you mean by this? Can you show us the directory structure you get, and tell us exactly what you are expecting instead?

Also, can you upload the contents of your webpack.config.js file to pastebin.com or pastie.org and share the link here?

Lastly, how are you running OpenMRS? Are you using the standalone? SDK? Enterprise?

Hi, thank you for getting back. I was using refapp 2.5 stand-alone version. According to the documentation, the build:deploy should deploy the owa to local server but you could see that the app’s structure was not there.

below is the webpack config file’s link http://pastie.org/10971827

Thanks

Based on your webpack.config.js (line #55), when you do a local deploy, the app will be copied to C:/Users/tsmith/Downloads/openmrs-standalone-2.5/appdata/owa/. Is this the same directory you are showing in the screenshot?

I see three apps in your screenshot, and the structure of the hivviralload app looks correct to me. The reason the file structure is different than the source is because the JavaScript files are concatenated (and minified/uglified) during the production build. This is the expected behaviour (see webpack.config.js#67).

Can you show the list Manage Apps page of the OWA Module? Also, can you build the ZIP file and deploy the app using the Manage Apps page and then upload the Tomcat log to pastie.org?

Hi, the zip file got the same structure as deploy-local. when I tried to upload the app from Manage App Screen, i got error message : “Manifest file could not be found in app”

Can you either share your ZIP file, or confirm that it contains a file called manifest.webapp in the root? Can you also share your Tomcat log and show us the output you get when you run npm run build:prod?

What version of the OWA Module are you running?

sorry, i missed the last part. I believe the version of owa is 1.6.3 that came with the reference app 2.5

:point_up: Can you provide us with these?

Hi, I sent the files to OpenMRS Talk so I guess it did not go through so here they are

what is the best way to send the zip file? I do not know how to use pastebin.

The problem was a bug in an outdated Webpack plugin. I fixed it and released a new version (v0.3.2). You’ll need to update the generator (npm install -g generator-openmrs-owa) and re-scaffold your app.

Let me know if this works.

Hi, the “prod” still produced the zip file with same webpack files and there was no changes for the “deploy” option (no app structure copied over to the local owa folder.

Tim

Regarding the directory structure, see my comment above:

The files are packed for the web, which is correct.

Does the app still not show up on your Manage Apps page? Do you still see the same error when you try to upload the ZIP file?

Pascal, thank you for helping with this. I was able to upload the zip file with no error. the only thing needed was the app definition and it worked!!

1 Like

Sure, no problem. The manifest.webapp file wasn’t getting copied to the dist folder, which is what I fixed in the v0.3.2 release.

To speed up your development cycle, consider running npm run watch. This will watch your files for changes and automatically redeploy when a change is detected. To manually deploy, running npm run build:deploy is the best option. Uploading the ZIP file is the most manual, and hence the slowest.