# \[bug-13808\]IAE: No page attached to this thread

**URL:** <https://forum.inductiveautomation.com/t/bug-13808-iae-no-page-attached-to-this-thread/24667>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [May 5, 2019, 6:44pm UTC](https://forum.inductiveautomation.com/t/bug-13808-iae-no-page-attached-to-this-thread/24667 "2019-05-05T18:44:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Katarn](https://avatars.discourse-cdn.com/v4/letter/k/ed655f/32.png) [@Katarn](https://forum.inductiveautomation.com/u/Katarn)\
**Post date:** [May 5, 2019, 6:44pm UTC](https://forum.inductiveautomation.com/t/bug-13808-iae-no-page-attached-to-this-thread/24667/1 "2019-05-05T18:44:01Z")

</div>

I’m attempting to perform navigation during a Barcode Scan Event, where when I scan the barcode the perspective Session Barcode Scanned Event constructs a `page` url based off of the text of the barcode. From my logging, the url is being constructed properly, but my Gateway logs are declaring an Illegal Argument Exception:

```auto
 com.inductiveautomation.perspective.gateway.script.PerspectiveScriptingFunctions.lambda$operateOnPage$18(PerspectiveScriptingFunctions.java:564) at
 com.inductiveautomation.perspective.gateway.script.PerspectiveScriptingFunctions.operateOnSession(PerspectiveScriptingFunctions.java:606) at
 com.inductiveautomation.perspective.gateway.script.PerspectiveScriptingFunctions.operateOnPage(PerspectiveScriptingFunctions.java:547) at
 com.inductiveautomation.perspective.gateway.script.PerspectiveScriptingFunctions.navigate(PerspectiveScriptingFunctions.java:78) at
 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
 java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at 
java.base/java.lang.reflect.Method.invoke(Unknown Source) java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: No perspective page attached to this thread.

```

The triggering code from the Perspective Session Barcode Scanned Event:

```auto
system.perspective.navigate(page=data.text)

```

I’ve also tried

```auto
system.perspective.navigate(page=data.text,sessionId=session.props.id)

```

but the IAE remained.

Could this stem from the fact that the “camera” screen is displayed while the script is executing?

If I modify the Session Barcode Scanned Event to write to a session prop, and I move the navigation to a component on a page which is bound to the session prop, and perform the navigation as part of an onChange script, the navigation performs as expected.

---

<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:** [May 7, 2019, 4:21pm UTC](https://forum.inductiveautomation.com/t/bug-13808-iae-no-page-attached-to-this-thread/24667/2 "2019-05-07T16:21:48Z")

</div>

I’m not completely sure whether this is “supposed” to work, so I filed an internal ticket so we can check it out and verify for sure. I’ll update this thread once that ticket is updated.

---

<div class="post-metadata">

**Author:** ![mrojas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrojas/32/6394_2.png) [@mrojas](https://forum.inductiveautomation.com/u/mrojas)\
**Post date:** [May 10, 2019, 8:50pm UTC](https://forum.inductiveautomation.com/t/bug-13808-iae-no-page-attached-to-this-thread/24667/3 "2019-05-10T20:50:37Z")

</div>

We’ve added the pageId to the context so you should have everything you need to navigate. You’ll end up calling `system.perspective.navigate(page=data.text, pageId=context.pageId)`. The change will show up in 8.0.2. Thanks again for the feedback.
