# Uncaught ReferenceError when deploy flow

**URL:** <https://discourse.nodered.org/t/uncaught-referenceerror-when-deploy-flow/61277>\
**Category:** General\
**Created:** [14 April 2022 09:09 UTC](https://discourse.nodered.org/t/uncaught-referenceerror-when-deploy-flow/61277 "2022-04-14T09:09:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jinx](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jinx](https://discourse.nodered.org/u/jinx)\
**Post date:** [14 April 2022 09:09 UTC](https://discourse.nodered.org/t/uncaught-referenceerror-when-deploy-flow/61277/1 "2022-04-14T09:09:24Z")

</div>

Node-RED version: 2.2.2(Maintenance Release)

Installation steps:

1. git clone [GitHub - node-red/node-red: Low-code programming for event-driven applications](https://github.com/node-red/node-red.git)  
cd node-red
2. npm install
3. npm run build
4. npm start

Problem:  
After put a "debug" node into a new blank flow, then press the "Deploy" button, whole web page is stucked in a gray view and following messages are shown in DevTools console of Chrome:

> JQMIGRATE: Migrate is installed, version 3.3.0  
> Uncaught ReferenceError: hasUnusedConfig is not defined  
> at Object. (red.min.js?v=2.2.2:18:112007)  
> at c (vendor.js?v=2.2.2:2:28294)  
> at Object.fireWith [as resolveWith] (vendor.js?v=2.2.2:2:29039)  
> at l (vendor.js?v=2.2.2:2:79800)  
> at XMLHttpRequest. (vendor.js?v=2.2.2:2:82254)

Is this a bug ? Or what should I do to fix this?

Thanks a lot~~

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [14 April 2022 09:12 UTC](https://discourse.nodered.org/t/uncaught-referenceerror-when-deploy-flow/61277/2 "2022-04-14T09:12:25Z")

</div>

Is there a reason you are cloning the code rather than installing a stable release from npm?

---

<div class="post-metadata">

**Author:** ![jinx](https://avatars.discourse-cdn.com/v4/letter/j/c6cbf5/32.png) [@jinx](https://discourse.nodered.org/u/jinx)\
**Post date:** [14 April 2022 09:44 UTC](https://discourse.nodered.org/t/uncaught-referenceerror-when-deploy-flow/61277/3 "2022-04-14T09:44:28Z")

</div>

You are right , installing Node-Red by:

> npm install -g --unsafe-perm node-red  
> would fix this problem.

Thanks~！

PS: It still might be a tiny bug in master branch of github repo ~

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [14 April 2022 09:49 UTC](https://discourse.nodered.org/t/uncaught-referenceerror-when-deploy-flow/61277/4 "2022-04-14T09:49:32Z")

</div>

> [@jinx](#):
>
> It still might be a tiny bug in master branch of github repo

Indeed - will need to look at that. Just wanted to make sure we got you running if you didn't really need to be running from git.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [18 April 2022 07:53 UTC](https://discourse.nodered.org/t/uncaught-referenceerror-when-deploy-flow/61277/5 "2022-04-18T07:53:48Z")

</div>

@jinx - this issue is now resolved.

Hitachi encountered the same thing and raised a pull request to fix it.

> <https://github.com/node-red/node-red/pull/3535>
>
> \<!--
> \## Before you hit that Submit button....
> 
> Please read our \[contribution …guidelines\](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md)
> before submitting a pull-request.
> 
> \## Types of changes
> 
> What types of changes does your code introduce?
> Put an \`x\` in the boxes that apply
> \--\>
> 
> \- \[x\] Bugfix (non-breaking change which fixes an issue)
> \- \[\] New feature (non-breaking change which adds functionality)
> 
> \<!--
> If you want to raise a pull-request with a new feature, or a refactoring
> of existing code, it \*\*may well get rejected\*\* if it hasn't been discussed on
> the \[forum\](https://discourse.nodered.org) or
> \[slack team\](https://nodered.org/slack) first.
> 
> \--\>
> 
> \## Proposed changes
> 
> 
> Recent changes in \`hasUnusedConfig\` variable declarations from \`var\` to \`let\` made the scope of the variable stricter. 
> As a result, the variable reference results in a reference error. 
> This PR try to corrects this.
> 
> \## Checklist
> 
> 
> \- \[x\] I have read the \[contribution guidelines\](https://github.com/node-red/node-red/blob/master/CONTRIBUTING.md)
> \- \[\] For non-bugfix PRs, I have discussed this change on the forum/slack team.
> \- \[x\] I have run \`grunt\` to verify the unit tests pass
> \- \[\] I have added suitable unit tests to cover the new/changed functionality

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [2 May 2022 07:54 UTC](https://discourse.nodered.org/t/uncaught-referenceerror-when-deploy-flow/61277/6 "2022-05-02T07:54:46Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
