Closed njogz closed 1 year ago
@njogz I'm getting: ERROR Webpack warnings when building contact-summary
when trying to compile and upload the configuration to my local CHT-core instance.
Environment: MacOS 13.1 (22C65); Docker desktop 4.15.0 (93002)l; Docker engine: 20.10.21 CHT 4.1.0: Local using docker compose files cht-core.yml and cht-couchdb.yml cht version: 3.15.2
Followed the instructions:
cht-config
directory by running cd cht-config
.npm install
to install the dependencies.cht --url=https://medic:****@****.my.local-ip.co --accept-self-signed-certs
Log:
INFO Checking that https://medic:****@****.my.local-ip.co/medic/ is available...
(node:2411) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
INFO Processing config in cht-config.
INFO Actions:
- check-git
- compile-app-settings
- backup-app-settings
- upload-app-settings
- convert-app-forms
- convert-collect-forms
- convert-contact-forms
- validate-app-forms
- validate-collect-forms
- validate-contact-forms
- backup-all-forms
- delete-all-forms
- upload-app-forms
- upload-collect-forms
- upload-contact-forms
- upload-resources
- upload-branding
- upload-partners
- upload-custom-translations
- upload-privacy-policies
INFO Starting action: check-git…
WARN There are changes in your local branch to be committed or not staged for commit.
WARN Changes untracked or to be committed:
M cht-config/package-lock.json
Are you sure you want to continue? [y/n]: y
INFO Fetching git upstream...
INFO check-git complete.
INFO Starting action: compile-app-settings…
WARN app_settings.json file should not be edited directly.
Please create a base_settings.json file in app_settings folder and move any manually defined configurations there.
INFO Packaging contact-summary
INFO Hash: b19913ebf5c6e3563270
Version: webpack 4.46.0
Child
Hash: b19913ebf5c6e3563270
Time: 1634ms
Built at: 02/15/2023 1:00:08 PM
Asset Size Chunks Chunk Names
./contact-summary.js 68 KiB 0 [emitted] main
Entrypoint main = ./contact-summary.js
[0] ./node_modules/moment/moment.js 147 KiB {0} [built]
[1] /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/src/contact-summary/lib.js 203 bytes {0} [built]
[2] ./contact-summary.templated.js 15.8 KiB {0} [built] [1 warning]
[3] (webpack)/buildin/module.js 497 bytes {0} [built]
[4] ./contact-summary-extras.js 15.9 KiB {0} [built] [1 warning]
[5] /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/src/contact-summary/contact-summary-emitter.js 3.41 KiB {0} [built]
WARNING in ./contact-summary.templated.js
Module Warning (from /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/eslint-loader/dist/cjs.js):
Failed to load config "@medic" to extend from.
Referenced from: /Users/marialorenarodriguezviruel/medic-workspace/interoperability/cht-config/.eslintrc
@ /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/src/contact-summary/lib.js 1:21-60
WARNING in ./contact-summary-extras.js
Module Warning (from /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/eslint-loader/dist/cjs.js):
Failed to load config "@medic" to extend from.
Referenced from: /Users/marialorenarodriguezviruel/medic-workspace/interoperability/cht-config/.eslintrc
@ ./contact-summary.templated.js 2:15-50
@ /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/src/contact-summary/lib.js
INFO Error: Webpack warnings when building contact-summary
at /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/src/lib/package-lib.js:103:23
at finalCallback (/Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/webpack/lib/MultiCompiler.js:254:12)
at /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/webpack/lib/MultiCompiler.js:277:6
at done (/Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/neo-async/async.js:2931:13)
at runCompilers (/Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/webpack/lib/MultiCompiler.js:181:48)
at /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/webpack/lib/MultiCompiler.js:188:7
at /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/webpack/lib/MultiCompiler.js:270:7
at finalCallback (/Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/webpack/lib/Compiler.js:257:39)
at /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/webpack/lib/Compiler.js:306:14
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
at AsyncSeriesHook.lazyCompileHook (/Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/tapable/lib/Hook.js:154:20)
at /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/webpack/lib/Compiler.js:304:22
at Compiler.emitRecords (/Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/webpack/lib/Compiler.js:499:39)
at /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/webpack/lib/Compiler.js:298:10
at /Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/webpack/lib/Compiler.js:485:14
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/marialorenarodriguezviruel/.nvm/versions/node/v16.17.1/lib/node_modules/cht-conf/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
ERROR Webpack warnings when building contact-summary
Found in the docs this reference to the error and tried the step suggested. The error is still showing.
I also tried to compile and upload /cht-core/config/default, and it was successful. What else can I try?
I got this error previously while trying to set up my local environment: See how I resolved it on the forum here.
@njogz @Phil-Mwago I was able to load the config to my local instance. But not following the README steps. @njogz are you able to load the config following the README steps?
This are the steps I followed:
ERROR Require exactly one of these parameter: --local --instance --url --archive
NAME cht - Configure your CHT instances
SYNOPSIS
cht <--local|--instance=instance-name|--url=url>
Or:
cht <--local|--instance=instance-name|--url=url|--archive>
DESCRIPTION This script updates and uploads a project's configuration.
SUPPORTED ACTIONS
SAVE CONFIG TO --local Upload to http://admin:pass@localhost:5988
--instance=
--user=
--url=
--archive
Save configuration content to files on disk. Requires parameter --destination=
OPTIONS --help Display this usage message
--shell-completion --shell-completion=bash Generate the shell-completion script for use in bash.
--source=
--supported-actions Display a list of supported actions.
--version Display the current version number.
--changelog Display application changelog.
--accept-self-signed-certs Allows cht-conf to work with self signed certs by telling node to ignore the error
--skip-dependency-check Skips checking the version running is set to the same version in the package.json
--skip-git-check Skips checking the status of the current repository that holds the configuration
--skip-translation-check Skips checking message translations
--skip-validate Skips form validation
--force CAN BE DANGEROUS! Passes yes to all commands and any where that would prompt to overwrite changes will overwrite automatically.
INFO Processing config in cht-config. INFO Actions:
4. Executed cht --url=https://medic:****@****.my.local-ip.co --accept-self-signed-certs
Log:
INFO Checking that https://medic:****@192-168-100-62.my.local-ip.co/medic/ is available...
(node:902) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use node --trace-warnings ...
to show where the warning was created)
INFO Processing config in cht-config.
INFO Actions:
horizontal
/compact
appearance. These have been deprecated in favor of the columns
appearance. Please update the following fields:
WARN - /replace_user/new_contact/ephemeral_dob/dob_method: replace [horizontal] with [columns]
WARN - /replace_user/new_contact/sex: replace [horizontal] with [columns]
INFO Validating form: undo_death_report.xml…
INFO validate-app-forms complete.
INFO Starting action: validate-collect-forms…
INFO validate-collect-forms complete.
INFO Starting action: validate-contact-forms…
INFO Validating form: clinic-create.xml…
INFO Validating form: clinic-edit.xml…
INFO Validating form: district_hospital-create.xml…
INFO Validating form: district_hospital-edit.xml…
INFO Validating form: health_center-create.xml…
INFO Validating form: health_center-edit.xml…
INFO Validating form: person-create.xml…
INFO Validating form: person-edit.xml…
INFO validate-contact-forms complete.
INFO Starting action: backup-all-forms…
INFO backup-all-forms complete.
INFO Starting action: delete-all-forms…
INFO delete-all-forms complete.
INFO Starting action: upload-app-forms…
INFO Preparing form for upload: death_report.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/death_report-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/death_report.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/death_report.xml uploaded
INFO Preparing form for upload: delivery.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/delivery-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/delivery.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/delivery.xml uploaded
INFO Preparing form for upload: interop_follow_up.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/interop_follow_up-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/interop_follow_up.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/interop_follow_up.xml uploaded
INFO Preparing form for upload: pnc_danger_sign_follow_up_baby.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pnc_danger_sign_follow_up_baby-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pnc_danger_sign_follow_up_baby.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pnc_danger_sign_follow_up_baby.xml uploaded
INFO Preparing form for upload: pnc_danger_sign_follow_up_mother.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pnc_danger_sign_follow_up_mother-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pnc_danger_sign_follow_up_mother.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pnc_danger_sign_follow_up_mother.xml uploaded
INFO Preparing form for upload: pregnancy.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy.xml uploaded
INFO Preparing form for upload: pregnancy_danger_sign.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy_danger_sign-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy_danger_sign.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy_danger_sign.xml uploaded
INFO Preparing form for upload: pregnancy_danger_sign_follow_up.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy_danger_sign_follow_up-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy_danger_sign_follow_up.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy_danger_sign_follow_up.xml uploaded
INFO Preparing form for upload: pregnancy_facility_visit_reminder.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy_facility_visit_reminder-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy_facility_visit_reminder.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy_facility_visit_reminder.xml uploaded
INFO Preparing form for upload: pregnancy_home_visit.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy_home_visit-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy_home_visit.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/pregnancy_home_visit.xml uploaded
INFO Preparing form for upload: replace_user.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/replace_user-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/replace_user.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/replace_user.xml uploaded
INFO Preparing form for upload: undo_death_report.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/undo_death_report-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/undo_death_report.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/app/undo_death_report.xml uploaded
INFO upload-app-forms complete.
INFO Starting action: upload-collect-forms…
INFO upload-collect-forms complete.
INFO Starting action: upload-contact-forms…
INFO Preparing form for upload: clinic-create.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/clinic-create-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/clinic-create.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/clinic-create.xml uploaded
INFO Preparing form for upload: clinic-edit.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/clinic-edit-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/clinic-edit.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/clinic-edit.xml uploaded
INFO Preparing form for upload: district_hospital-create.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/district_hospital-create-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/district_hospital-create.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/district_hospital-create.xml uploaded
INFO Preparing form for upload: district_hospital-edit.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/district_hospital-edit-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/district_hospital-edit.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/district_hospital-edit.xml uploaded
INFO Preparing form for upload: health_center-create.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/health_center-create-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/health_center-create.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/health_center-create.xml uploaded
INFO Preparing form for upload: health_center-edit.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/health_center-edit-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/health_center-edit.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/health_center-edit.xml uploaded
INFO Preparing form for upload: person-create.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/person-create-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/person-create.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/person-create.xml uploaded
INFO Preparing form for upload: person-edit.xml…
INFO No media directory found at /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/person-edit-media for form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/person-edit.xml
INFO Form /Users/marialorenarodriguezviruel/medic-workspace/cht-config/forms/contact/person-edit.xml uploaded
INFO upload-contact-forms complete.
INFO Starting action: upload-resources…
INFO Configuration not uploaded as no changes found
INFO upload-resources complete.
INFO Starting action: upload-branding…
WARN No configuration file found at path: /Users/marialorenarodriguezviruel/medic-workspace/cht-config/branding.json
INFO upload-branding complete.
INFO Starting action: upload-partners…
WARN No configuration file found at path: /Users/marialorenarodriguezviruel/medic-workspace/cht-config/partners.json
INFO upload-partners complete.
INFO Starting action: upload-custom-translations…
WARN Empty message found for key 'report.delivery.babys_condition.baby_repeat' in 'en' translation
WARN Empty message found for key 'report.delivery.pnc_visits.who_note' in 'en' translation
WARN Empty message found for key 'report.pregnancy_facility_visit_reminder.facility_visit_reminder.remind_note' in 'en' translation
WARN Empty message found for key 'report.pregnancy_danger_sign_follow_up.danger_signs.congratulate_no_ds_note' in 'en' translation
WARN Empty message found for key 'report.pregnancy_home_visit.pregnancy_ended.miscarriage_note' in 'en' translation
WARN Empty message found for key 'report.pregnancy.gestational_age.register_method.register_note' in 'en' translation
WARN Empty message found for key 'report.pregnancy.gestational_age.method_lmp.u_lmp_date' in 'en' translation
WARN Empty message found for key 'report.pregnancy.gestational_age.method_lmp.method_lmp' in 'en' translation
WARN Found 8 empty messages trying to compile translations
INFO Translation /Users/marialorenarodriguezviruel/medic-workspace/cht-config/translations/messages-en.properties not uploaded as no changes were found
INFO upload-custom-translations complete.
INFO Starting action: upload-privacy-policies…
INFO Privacy policies file not uploaded as no changes found
INFO upload-privacy-policies complete.
INFO All actions completed.
Here are the errors I encountered and the workarounds I identified in order to upload the config:
README
, I got the same error as @lorerod.node
version. I had to switch to v12 (I had v16 locally).Failed to load config "@medic" to extend from. Referenced from: /Users/andra/Documents/GitHub/interoperability/cht-config/.eslintrc @ /opt/homebrew/lib/node_modules/cht-conf/src/contact-summary/lib.js 1:21-60
cht initialise-project-layout
, before thecht --url ...
command and got a different error, which seemed connected to es2018
:../.eslintrc: Environment key "es2018" is unknown
es2018
to es2020
in the .eslintrc
file, and the error changed to:/Users/andra/Documents/GitHub/interoperability/cht-config/contact-summary.templated.js 5:3 error Newline required at end of file but not found eol-last
"eol-last": 2,
line in the .eslintrc
file (or change it to "eol-last": 0,
), and the config uploaded without any error. @njogz @samuelimoisili did you bump into the same problems? If not, is there anything in the steps that I mentioned that is not done correctly, or anything I might have missed?
@andrablaj Yes, I faced the same issue. I'm creating a new PR to fix the bugs.
Thanks, @samuelimoisili. Is there any blocker to perform the fixes via this same branch? I am new to the repo so I might miss something.
I moved this issue back to In Progress
@samuelimoisili. I think it is better for traceability if we continue with this same issue, but it could be in a different PR.
@andrablaj I have merged the fix by @samuelimoisili. Please pull the latest comment on the branch and test again.
Add the required forms and tasks to enable communication between the CHT and the OpenHIM mediator