# Facing issue while using Customwidget in Dojotoolkit

**URL:** <https://discourse.dojo.io/t/facing-issue-while-using-customwidget-in-dojotoolkit/469>\
**Category:** Dojo 1.x users\
**Created:** [January 30, 2020, 6:35am UTC](https://discourse.dojo.io/t/facing-issue-while-using-customwidget-in-dojotoolkit/469 "2020-01-30T06:35:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![uhgar](https://avatars.discourse-cdn.com/v4/letter/u/e5b9ba/32.png) [@uhgar](https://discourse.dojo.io/u/uhgar)\
**Post date:** [January 30, 2020, 6:35am UTC](https://discourse.dojo.io/t/facing-issue-while-using-customwidget-in-dojotoolkit/469/1 "2020-01-30T06:35:54Z")

</div>

Pls see the stackoverflow link, “[https://stackoverflow.com/questions/59892521/facing-error-while-creating-custom-widget-in-dojo-could-not-identify-the-reason](https://stackoverflow.com/questions/59892521/facing-error-while-creating-custom-widget-in-dojo-could-not-identify-the-reason)”.

Unfortunately no help from Stackoverflow

If anyone know the answer pls let me know.

---

<div class="post-metadata">

**Author:** ![dylan](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dojo.io/dylan/32/5_2.png) [@dylan](https://discourse.dojo.io/u/dylan)\
**Post date:** [January 30, 2020, 12:45pm UTC](https://discourse.dojo.io/t/facing-issue-while-using-customwidget-in-dojotoolkit/469/2 "2020-01-30T12:45:59Z")

</div>

This error generally occurs from attempting to parse a widget before you’ve loaded all of its dependencies and made sure the DOM is ready.

I would check the following:

In CustomPopup.js

- Add a final dependency of “dojo/domReady!” in your list of dependencies (final dependency, as it doesn’t need a callback)
- I’m not sure why you want dojo/parser in your list of dependencies within the widget itself. That shouldn’t be necessary

In your main.js or whatever is initiating the parsing:

- Make sure you’re waiting for the DOM to be ready before parsing the page
- Make sure the CustomPopup and its dependencies have loaded before parsing the page by requiring them in whatever define or require block loads your code before you run the parser.

---

<div class="post-metadata">

**Author:** ![nicolasiac](https://avatars.discourse-cdn.com/v4/letter/n/ee7513/32.png) [@nicolasiac](https://discourse.dojo.io/u/nicolasiac)\
**Post date:** [January 31, 2020, 7:05am UTC](https://discourse.dojo.io/t/facing-issue-while-using-customwidget-in-dojotoolkit/469/3 "2020-01-31T07:05:27Z")

</div>

You should never use id for dojo widgets.  
Use data-dojo-attach-point instead
