# Module with Perspective Component Dependencies

**URL:** <https://forum.inductiveautomation.com/t/module-with-perspective-component-dependencies/98809>\
**Category:** Module Development\
**Tags:** ignition81, perspective\
**Created:** [November 19, 2024, 7:29pm UTC](https://forum.inductiveautomation.com/t/module-with-perspective-component-dependencies/98809 "2024-11-19T19:29:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grace\_Gan](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@Grace\_Gan](https://forum.inductiveautomation.com/u/Grace_Gan)\
**Post date:** [November 19, 2024, 7:29pm UTC](https://forum.inductiveautomation.com/t/module-with-perspective-component-dependencies/98809/1 "2024-11-19T19:29:38Z")

</div>

I'm trying to set up a module with the perspective dependencies, but getting the following error:

```python
The import com.inductiveautomation.perspective cannot be resolved

```

In my build.gradle.kts file, I've included the module dependencies as follow

```python
moduleDependencies = mapOf(
      "GD" to "com.inductiveautomation.perspective"
  )

```

And in my common scope build.gradle.kts file I've also included the following

```python
dependencies {
    // add common scoped dependencies here
    compileOnly("com.inductiveautomation.ignitionsdk:ignition-common:${rootProject.extra["sdk_version"]}")
    compileOnly("com.inductiveautomation.ignitionsdk:perspective-common:${rootProject.extra["sdk_version"]}")
}

```

Everything else in my build.gradle.kts file and settings.gradle file is generated by defaulted when creating the module project using gradle build tool. Am I missing anything?

---

<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:** [November 19, 2024, 10:42pm UTC](https://forum.inductiveautomation.com/t/module-with-perspective-component-dependencies/98809/2 "2024-11-19T22:42:30Z")

</div>

Where are you getting that error? In your IDE?

---

<div class="post-metadata">

**Author:** ![Grace\_Gan](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@Grace\_Gan](https://forum.inductiveautomation.com/u/Grace_Gan)\
**Post date:** [November 19, 2024, 10:45pm UTC](https://forum.inductiveautomation.com/t/module-with-perspective-component-dependencies/98809/3 "2024-11-19T22:45:51Z")

</div>

Yup, I'm using VSCode

---

<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:** [November 19, 2024, 10:49pm UTC](https://forum.inductiveautomation.com/t/module-with-perspective-component-dependencies/98809/4 "2024-11-19T22:49:59Z")

</div>

> [@Grace\_Gan](#):
>
> And in my common scope build.gradle.kts file I've also included the following

Okay, so where is the file you're editing where you're getting that error?  
`compileOnly` dependencies, even of a Gradle subproject that's pulled in by another subproject, are not shared - so you would need to redeclare these common scoped dependencies in e.g. `gateway` if you were authoring a Java file in `gateway`; e.g:

> <https://github.com/inductiveautomation/ignition-sdk-examples/blob/276f89239073e2108253716bce7f4ff70d20698d/perspective-component-minimal/gateway/build.gradle.kts#L12-L21>

> <https://github.com/inductiveautomation/ignition-sdk-examples/blob/276f89239073e2108253716bce7f4ff70d20698d/perspective-component-minimal/common/build.gradle.kts#L13-L20>

---

<div class="post-metadata">

**Author:** ![Grace\_Gan](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@Grace\_Gan](https://forum.inductiveautomation.com/u/Grace_Gan)\
**Post date:** [November 19, 2024, 10:50pm UTC](https://forum.inductiveautomation.com/t/module-with-perspective-component-dependencies/98809/5 "2024-11-19T22:50:55Z")

</div>

The file is located in common scope folder

---

<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:** [November 19, 2024, 10:52pm UTC](https://forum.inductiveautomation.com/t/module-with-perspective-component-dependencies/98809/6 "2024-11-19T22:52:59Z")

</div>

🤷‍♂️ I don't use VSCode so I can't advise much more than broad strokes.  
In IntelliJ, you have to sometimes update the IDE's internal 'model' of the project to sync it up with Gradle's model of the project. Can you build via the command line, independent of VSC, or does it throw the same error? That would help isolate the nature of the problem.

---

<div class="post-metadata">

**Author:** ![Grace\_Gan](https://avatars.discourse-cdn.com/v4/letter/g/e5b9ba/32.png) [@Grace\_Gan](https://forum.inductiveautomation.com/u/Grace_Gan)\
**Post date:** [November 19, 2024, 11:23pm UTC](https://forum.inductiveautomation.com/t/module-with-perspective-component-dependencies/98809/7 "2024-11-19T23:23:05Z")

</div>

You're right, it seems to be an ide issue with problem detecting the dependencies. Things seem to be working now after running `./gradlew --refresh-dependencies` and triggering the reload window command in vscode.

Thanks for your time!
