# Uploading tasks.js break everything

**URL:** <https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499>\
**Category:** Technical Support\
**Tags:** tasks\
**Created:** [May 9, 2024, 10:21am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499 "2024-05-09T10:21:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![SanghArsha\_PyakuRel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sangharsha_pyakurel/32/3023_2.png) [@SanghArsha\_PyakuRel](https://forum.communityhealthtoolkit.org/u/SanghArsha_PyakuRel)\
**Post date:** [May 9, 2024, 10:21am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/1 "2024-05-09T10:21:29Z")

</div>

I started app development from get strated step by step after i goes to task field after that all the contact forms are hide and no add anything will show only access form is shown in report .how to solve this issue please anyone help me.

---

<div class="post-metadata">

**Author:** ![binod](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/binod/32/60_2.png) [@binod](https://forum.communityhealthtoolkit.org/u/binod)\
**Post date:** [May 9, 2024, 10:29am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/2 "2024-05-09T10:29:04Z")

</div>

Welcome to the CHT forum @SanghArsha_PyakuRel !

I am sorry to know that you are having problems with tasks.js.  
To be able to help you solve the problem, we will need some more details:

- What does your tasks.js look like?
- Are there any errors in the browser console?
- Have you tried deploying our [default config](http://github.com/medic/cht-core/tree/master/config/default)?

---

<div class="post-metadata">

**Author:** ![SanghArsha\_PyakuRel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sangharsha_pyakurel/32/3023_2.png) [@SanghArsha\_PyakuRel](https://forum.communityhealthtoolkit.org/u/SanghArsha_PyakuRel)\
**Post date:** [May 9, 2024, 10:38am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/3 "2024-05-09T10:38:11Z")

</div>

my tasks.js look like this:

module.exports = [  
{  
name: ‘assessment-after-registration’,  
title: ‘First Assessment’,  
icon: ‘icon-healthcare’,  
appliesTo: ‘contacts’,  
appliesToType: [‘patient’],  
appliesIf: c =\> user.parent && user.parent.contact\_type === ‘chw\_area’ && !c.contact.date\_of\_death && !c.contact.muted,  
actions: [{ form: ‘assessment’ }],  
events: [{  
start: 7,  
days: 7,  
end: 0,  
}],  
},

];  
after this i load the content by using this command:  
cht --url=https://\<username\>:\<password\>@localhost  
it update the localhost run in browser after this contact form are not seen and any add button show only see assess form in repot

---

<div class="post-metadata">

**Author:** ![SanghArsha\_PyakuRel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sangharsha_pyakurel/32/3023_2.png) [@SanghArsha\_PyakuRel](https://forum.communityhealthtoolkit.org/u/SanghArsha_PyakuRel)\
**Post date:** [May 9, 2024, 10:40am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/4 "2024-05-09T10:40:42Z")

</div>

![Screenshot from 2024-05-09 16-24-37](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/1/16d2817b1bee8a55653fdb62eb038229a101d773.png)

---

<div class="post-metadata">

**Author:** ![SanghArsha\_PyakuRel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sangharsha_pyakurel/32/3023_2.png) [@SanghArsha\_PyakuRel](https://forum.communityhealthtoolkit.org/u/SanghArsha_PyakuRel)\
**Post date:** [May 9, 2024, 10:41am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/5 "2024-05-09T10:41:46Z")

</div>

![Screenshot from 2024-05-09 16-26-10](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/8/8b6e2abdfe495c6579c7edf280d5c56270aa2fdc.png)

---

<div class="post-metadata">

**Author:** ![SanghArsha\_PyakuRel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sangharsha_pyakurel/32/3023_2.png) [@SanghArsha\_PyakuRel](https://forum.communityhealthtoolkit.org/u/SanghArsha_PyakuRel)\
**Post date:** [May 9, 2024, 10:43am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/6 "2024-05-09T10:43:08Z")

</div>

![Screenshot from 2024-05-09 16-27-28](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/e/e8993c687952acddab84a6b25d9f5db4b1eac38d.png)

---

<div class="post-metadata">

**Author:** ![SanghArsha\_PyakuRel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sangharsha_pyakurel/32/3023_2.png) [@SanghArsha\_PyakuRel](https://forum.communityhealthtoolkit.org/u/SanghArsha_PyakuRel)\
**Post date:** [May 9, 2024, 10:45am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/7 "2024-05-09T10:45:23Z")

</div>

![Screenshot from 2024-05-09 16-29-42](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/b/b3fc44bfccce7ad1d1e26a980ea840f1ee588463.png)

---

<div class="post-metadata">

**Author:** ![binod](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/binod/32/60_2.png) [@binod](https://forum.communityhealthtoolkit.org/u/binod)\
**Post date:** [May 9, 2024, 6:18pm UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/8 "2024-05-09T18:18:41Z")

</div>

Could you please scroll down a bit further in the browser console to see if there are other errors?

Also, you can try simplifying the `appliesIf` by removing some parts and checking if that solves the problem.

---

<div class="post-metadata">

**Author:** ![SanghArsha\_PyakuRel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sangharsha_pyakurel/32/3023_2.png) [@SanghArsha\_PyakuRel](https://forum.communityhealthtoolkit.org/u/SanghArsha_PyakuRel)\
**Post date:** [May 10, 2024, 4:35am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/9 "2024-05-10T04:35:05Z")

</div>

![Screenshot from 2024-05-10 10-19-41](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/5/5e4248f445d1cc9c3d9d123ed856efcfbce83e1b.png)

---

<div class="post-metadata">

**Author:** ![binod](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/binod/32/60_2.png) [@binod](https://forum.communityhealthtoolkit.org/u/binod)\
**Post date:** [May 10, 2024, 4:40pm UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/10 "2024-05-10T16:40:46Z")

</div>

Are you still logged in as the admin/medic user?  
If so, the change in `tasks.js` should not affect the admin user.

If you want to be sure that it’s not the tasks breaking your contact forms, you can keep it empty and upload.

`tasks.js`:

```auto
module.exports = [];

```

I suspect that, in your case, the contact forms do not match the ones defined in the app settings.

Can you see the contact forms when you go to this page as an admin user?  
`https://192-168-31-82.local-ip.medicmobile.org:10443/admin/#/forms`

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/0/0664ae15b47e79a41360b32d65d09c65c085975c.png)

If you can see entries like `form:contact:*` similar to above, do they match with your hierarchy definition (contact\_types) in your `base_settings.json` or `app_settings.json`?

Here is an example from the default config:

> <https://github.com/medic/cht-core/blob/4ced6937a73b105fa2a970d729e3803afd29893a/config/default/app_settings.json#L306-L314>

The `create_form` defined in line 314 matches with the contact form shown in the screenshot above.

Please check your settings and share.

---

<div class="post-metadata">

**Author:** ![SanghArsha\_PyakuRel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sangharsha_pyakurel/32/3023_2.png) [@SanghArsha\_PyakuRel](https://forum.communityhealthtoolkit.org/u/SanghArsha_PyakuRel)\
**Post date:** [May 12, 2024, 5:27am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/11 "2024-05-12T05:27:05Z")

</div>

My app forms is like this:

 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/e/eb8585f2a19f3eca16505aad4244a216a1486ef0.png)

---

<div class="post-metadata">

**Author:** ![SanghArsha\_PyakuRel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sangharsha_pyakurel/32/3023_2.png) [@SanghArsha\_PyakuRel](https://forum.communityhealthtoolkit.org/u/SanghArsha_PyakuRel)\
**Post date:** [May 12, 2024, 5:28am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/12 "2024-05-12T05:28:21Z")

</div>

in my base\_settings.json is like this:

 ![Screenshot from 2024-05-12 11-12-27](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/f/f2340840c828dc0c2a35038a2acb7feba5d88eb6.png)

---

<div class="post-metadata">

**Author:** ![binod](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/binod/32/60_2.png) [@binod](https://forum.communityhealthtoolkit.org/u/binod)\
**Post date:** [May 13, 2024, 7:06am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/13 "2024-05-13T07:06:10Z")

</div>

> [@SanghArsha\_PyakuRel](#):
>
> My app forms is like this:
> 
> ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/e/eb8585f2a19f3eca16505aad4244a216a1486ef0.png)

The contact forms seem to be missing here.

Can you please check your `forms/contact` folder?  
 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/c/c086dfc963d49b5cde0f26bf178aec67aae49143.png)

---

<div class="post-metadata">

**Author:** ![SanghArsha\_PyakuRel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sangharsha_pyakurel/32/3023_2.png) [@SanghArsha\_PyakuRel](https://forum.communityhealthtoolkit.org/u/SanghArsha_PyakuRel)\
**Post date:** [May 13, 2024, 7:30am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/14 "2024-05-13T07:30:57Z")

</div>

Nothing inside this .

---

<div class="post-metadata">

**Author:** ![binod](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/binod/32/60_2.png) [@binod](https://forum.communityhealthtoolkit.org/u/binod)\
**Post date:** [May 13, 2024, 7:50am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/15 "2024-05-13T07:50:18Z")

</div>

> [@SanghArsha\_PyakuRel](#):
>
> Nothing inside this .

Please get the contact forms from here and upload them with `cht`:

> **[cht-core/config/default/forms/contact at master · medic/cht-core](https://github.com/medic/cht-core/tree/master/config/default/forms/contact)**
>
> The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the ...

After you run `cht`, please check the admin page again:

> [@binod](#):
>
> [https://192-168-31-82.local-ip.medicmobile.org:10443/admin/#/forms](https://192-168-31-82.local-ip.medicmobile.org:10443/admin/#/forms)

---

<div class="post-metadata">

**Author:** ![SanghArsha\_PyakuRel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sangharsha_pyakurel/32/3023_2.png) [@SanghArsha\_PyakuRel](https://forum.communityhealthtoolkit.org/u/SanghArsha_PyakuRel)\
**Post date:** [May 13, 2024, 11:08am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/16 "2024-05-13T11:08:49Z")

</div>

![Screenshot from 2024-05-13 16-52-25](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/d/d4401350b1f520baee70a62106677923658301ef.png)  
Thank You So Much Sir ! it works.

---

<div class="post-metadata">

**Author:** ![binod](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/binod/32/60_2.png) [@binod](https://forum.communityhealthtoolkit.org/u/binod)\
**Post date:** [May 13, 2024, 11:32am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/17 "2024-05-13T11:32:52Z")

</div>

> [@SanghArsha\_PyakuRel](#):
>
> it works.

You are welcome. I am glad that it worked. 🙂

You had mentioned:

> [@SanghArsha\_PyakuRel](#):
>
> I started app development from get strated step by step

Is this the tutorial that you have been following?

> **[Getting started building a CHT app](https://docs.communityhealthtoolkit.org/apps/tutorials/local-setup/)**
>
> Setting up a local environment to build and test CHT 4.x applications

Please feel free to suggest improvements to it so that it can be helpful for the new developers. You can suggest edits from the links available at the top right section of the CHT Docs:  
 ![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/9/9d03de16686c96bd914360cccec766472d6f8db2.png)

---

<div class="post-metadata">

**Author:** ![SanghArsha\_PyakuRel](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/sangharsha_pyakurel/32/3023_2.png) [@SanghArsha\_PyakuRel](https://forum.communityhealthtoolkit.org/u/SanghArsha_PyakuRel)\
**Post date:** [May 14, 2024, 4:26am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/18 "2024-05-14T04:26:42Z")

</div>

> [@SanghArsha\_PyakuRel](#):
>
> started app development from get strated step by step after i goes to task field after that all the contact forms are hide and no add anything will show only access form is shown in report .

Issue like this :

 ![Screenshot from 2024-05-14 10-11-05](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/d/d31f51d88ae670646dd29ac4fe08709bc7e56eb7.png)

---

<div class="post-metadata">

**Author:** ![binod](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/binod/32/60_2.png) [@binod](https://forum.communityhealthtoolkit.org/u/binod)\
**Post date:** [May 14, 2024, 5:16am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/19 "2024-05-14T05:16:51Z")

</div>

You haven’t answer to my question above:

> [@binod](#):
>
> Is this the tutorial that you have been following?
> 
> [Getting started building a CHT app | Community Health Toolkit](https://docs.communityhealthtoolkit.org/apps/tutorials/local-setup/)

From your problem description, I think it should be a documentation issue.  
If the problem is with the CHT core, then only it goes to the project issue (`cht-core` repo).

![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/5/5b01914d8e1762d71980db3acf4d762f1377452b.png)

From the relevant page in CHT docs, you can click on `Create documentation issue` to create an issue in `cht-docs`. We will probably require more details on what happened at what step of the tutorial/guide, and what improvements you would suggest to make it better.

You can also click on `Edit this page` and suggest improvements directly in the form of a pull request.

---

<div class="post-metadata">

**Author:** ![antony](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/antony/32/69_2.png) [@antony](https://forum.communityhealthtoolkit.org/u/antony)\
**Post date:** [May 15, 2024, 8:05am UTC](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499/20 "2024-05-15T08:05:29Z")

</div>

Thanks @SanghArsha_PyakuRel for creating [a documentation issue](https://github.com/medic/cht-docs/issues/1389), we will update the documentation and keep you posted.

[Next page](https://forum.communityhealthtoolkit.org/t/uploading-tasks-js-break-everything/3499.md?page=2)
