# Perspective Scope Weird Behavior

**URL:** <https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742>\
**Category:** Module Development\
**Tags:** perspective\
**Created:** [October 24, 2024, 5:09pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742 "2024-10-24T17:09:54Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Zhou](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Jason\_Zhou](https://forum.inductiveautomation.com/u/Jason_Zhou)\
**Post date:** [October 24, 2024, 5:09pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/1 "2024-10-24T17:09:54Z")

</div>

So I'm working on a module that implements a react component, and upon installation, it seems I've messed with the perspective module itself.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/e/4e2a546cae42e43e8144a4dede57922b2617c648.png)

And when I try to create a view I get this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/7/d72f8d61a3f066e301ca9985220148c61d168304.png)

From the error log, it seems like there was an error involved with the designer.navtree.model. How... do I begin to investigate and debug this?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 24, 2024, 5:14pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/2 "2024-10-24T17:14:39Z")

</div>

Are you registering a bundle with `BundleUtil` in your designer scoped hook?

---

<div class="post-metadata">

**Author:** ![Jason\_Zhou](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Jason\_Zhou](https://forum.inductiveautomation.com/u/Jason_Zhou)\
**Post date:** [October 24, 2024, 5:16pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/3 "2024-10-24T17:16:26Z")

</div>

Yes, exactly like how it's done in the example project:

> <https://github.com/inductiveautomation/ignition-sdk-examples/blob/276f89239073e2108253716bce7f4ff70d20698d/perspective-component/designer/src/main/java/org/fakester/designer/RadDesignerHook.java>

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 24, 2024, 5:22pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/4 "2024-10-24T17:22:22Z")

</div>

What name are you using for the bundle? The ~~first~~ last argument.

---

<div class="post-metadata">

**Author:** ![Jason\_Zhou](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Jason\_Zhou](https://forum.inductiveautomation.com/u/Jason_Zhou)\
**Post date:** [October 24, 2024, 5:24pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/5 "2024-10-24T17:24:16Z")

</div>

As I'm trying to follow the example as closely as possible, I guessed that you want to pass in the value of what URL\_ALIAS is here in this file:

> <https://github.com/inductiveautomation/ignition-sdk-examples/blob/276f89239073e2108253716bce7f4ff70d20698d/perspective-component/common/src/main/java/org/fakester/common/RadComponents.java>

So I passed in my value for both the first and last arguments.

---

<div class="post-metadata">

**Author:** ![Jason\_Zhou](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Jason\_Zhou](https://forum.inductiveautomation.com/u/Jason_Zhou)\
**Post date:** [October 24, 2024, 5:27pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/6 "2024-10-24T17:27:33Z")

</div>

I should also mention that the component did make its way in, at least in the perspective components sidebar.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 24, 2024, 5:32pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/7 "2024-10-24T17:32:19Z")

</div>

I'm grasping at straws, because what appears to have happened in the first screenshot is that the bundle for Perspective (prefixed/named `perspective`) is not available. The only way I can see that happening as a result of your module is if you're inadvertently colliding with that name.

Basic troubleshooting stuff:  
Does it persist if you restart the designer?  
Does it go back to normal if you uninstall your module?

---

<div class="post-metadata">

**Author:** ![Jason\_Zhou](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Jason\_Zhou](https://forum.inductiveautomation.com/u/Jason_Zhou)\
**Post date:** [October 24, 2024, 5:39pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/8 "2024-10-24T17:39:35Z")

</div>

Ah okay I have other helpful information here then. So across all of my project scope files, my attempts to import anything starting with "com.inductiveautomation.perspective" fail.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/9/497fb8a254f3549a0a485625be4263f814320a99.png)

As you can see I'm currently "modlImplentation"ing "perspective.common" and "perspective.gateway". I've also tried applying "compileOnly" and "implementation", which didn't change the error lints in my IDE, but to be fair I haven't yet tried to open a designer and see yet. I'll go ahead and try those now.

At the time I thought maybe my IDE was wrong about its linting, as I was still able to build, upload the module without issues, and even see the component show up in the browser.

Additionally I should also mention that one potentially big difference between my project, and the example project is in the root's build.gradle.kts. We have a 'subprojects' block:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/0/5065717f4f44f994c54278d1fabb5ca61e1ace5c.png)

I've tried also adding perspective.common and perspective.gateway here as compileOnly's, but that seems to cause trouble as well

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 24, 2024, 5:44pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/9 "2024-10-24T17:44:51Z")

</div>

Well you're not going to be able to resolve those dependencies with our public Nexus maven repo commented out (the `ignitionsdk` stuff should all be [`compileOnly`](https://docs.gradle.org/current/userguide/dependency_configurations.html#sec:what-are-dependency-configurations), by the way, because we're going to provide the dependencies for you at runtime).

But that's not (probably) the root cause of what you're seeing here.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 24, 2024, 5:45pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/10 "2024-10-24T17:45:44Z")

</div>

> [@Jason\_Zhou](#):
>
> We have a 'subprojects' block:

Yeah, you shouldn't be declaring dependencies in `subprojects` at the parent, because those dependencies don't make sense to (some) of the child projects.

---

<div class="post-metadata">

**Author:** ![Jason\_Zhou](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Jason\_Zhou](https://forum.inductiveautomation.com/u/Jason_Zhou)\
**Post date:** [October 24, 2024, 5:49pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/11 "2024-10-24T17:49:04Z")

</div>

Changing them to "compileOnly" actually does solve the issue! Do you have any idea why the IDE still complains and thinks there's errors?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 24, 2024, 5:51pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/12 "2024-10-24T17:51:42Z")

</div>

You must be using cached local versions of these dependencies or something, because there's no way you're resolving the `ignitionsdk` dependencies without our public Maven repo.

Take a look at [GitHub - IgnitionModuleDevelopmentCommunity/ignition-extensions](https://github.com/IgnitionModuleDevelopmentCommunity/ignition-extensions) for a clean/modern Gradle setup for Ignition. It doesn't have any Perspective customization, but it's pretty simple to copy from.

---

<div class="post-metadata">

**Author:** ![Jason\_Zhou](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@Jason\_Zhou](https://forum.inductiveautomation.com/u/Jason_Zhou)\
**Post date:** [October 24, 2024, 5:57pm UTC](https://forum.inductiveautomation.com/t/perspective-scope-weird-behavior/97742/13 "2024-10-24T17:57:21Z")

</div>

I'm going to throw out some guesses as to how things could be working on my end:

Maybe this buildscript block in the root build.gradle.kts is taking care of it:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/8/d8c76dea69c95a09b1f8241bb0f42c87a7ce099f.png)

Or the root setting.gradle.kts is also covering for it:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/7838bc97189bb106d3960988cee2b1f0c39025d3.png)

Because in both the perspective-component example, and the repo you just linked, the maven repo isn't declared in any of the project-scope specific build.kts files. And I can see in both projects how they might be applying it globally in some way.
