# Urgent Bug Report: Critical Issue with Publishing Agents - Unexpected token 'export' 🚨

**URL:** <https://community.mindstudio.ai/t/urgent-bug-report-critical-issue-with-publishing-agents-unexpected-token-export/1692>\
**Category:** Bug Reports\
**Created:** [September 26, 2025, 3:30pm UTC](https://community.mindstudio.ai/t/urgent-bug-report-critical-issue-with-publishing-agents-unexpected-token-export/1692 "2025-09-26T15:30:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![satya.k](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@satya.k](https://community.mindstudio.ai/u/satya.k)\
**Post date:** [September 26, 2025, 3:30pm UTC](https://community.mindstudio.ai/t/urgent-bug-report-critical-issue-with-publishing-agents-unexpected-token-export/1692/1 "2025-09-26T15:30:22Z")

</div>

Hi MindStudio Community,

I’m writing to report a critical and urgent bug that is preventing me from publishing a production-ready agent. My workflow, which relies on a hybrid model of scripts and LLMs, functions perfectly in the “Open Draft Agent” environment but fails immediately upon publication. This is a complete blocker for deployment.

**The Core Problem:**

The agent uses JavaScript `Run Function` blocks that require the **Virtual Machine** execution environment to import external libraries. While I’ve configured this setting in my draft, the platform is automatically reverting the environment to **Sandbox** mode during the publishing process.

This environment mismatch causes a fatal error: `Unexpected token 'export' [<mindstudio-vm>:` since the Sandbox environment does not support the `export` keyword used for module imports.

**Additional Glitches:**

Beyond the primary error, I’ve observed other nodes returning `null` outputs in the published version, which function correctly in the draft. This points to a deeper issue with how the agent’s state is handled upon publishing, suggesting a critical bug in the platform’s deployment logic.

This is an urgent matter as it makes my entire project unpublishable.

**Steps to Reproduce:**

1. Create an agent with a `Run Function` block that uses an external library and an `export default` statement.

2. Set the `Run Function` environment to `Virtual Machine`.

3. Confirm the workflow runs successfully in “Open Draft Agent”.

4. Publish the agent.

5. Execute the published agent. It will fail.

I am ready to provide screenshots of the working draft execution and the failing published run logs to help with the diagnosis.

I would greatly appreciate any immediate assistance or a workaround for this critical issue.

Thanks,  
Satya.K

---

<div class="post-metadata">

**Author:** ![Alex\_MindStudio](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.mindstudio.ai/alex_mindstudio/32/27_2.png) [@Alex\_MindStudio](https://community.mindstudio.ai/u/Alex_MindStudio)\
**Post date:** [September 26, 2025, 3:31pm UTC](https://community.mindstudio.ai/t/urgent-bug-report-critical-issue-with-publishing-agents-unexpected-token-export/1692/2 "2025-09-26T15:31:29Z")

</div>

Hi @satya.k,

Could you please share the AI Agent ID where the issue occurs? You can find it by clicking on the Agent name and copying the Agent ID at the bottom of the page.

 ![image](https://canada1.discourse-cdn.com/flex008/uploads/mindstudio/original/1X/3cba891111e41dd30648e31cd279adb1eaece48a.png)

---

<div class="post-metadata">

**Author:** ![satya.k](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@satya.k](https://community.mindstudio.ai/u/satya.k)\
**Post date:** [September 29, 2025, 9:16am UTC](https://community.mindstudio.ai/t/urgent-bug-report-critical-issue-with-publishing-agents-unexpected-token-export/1692/3 "2025-09-29T09:16:36Z")

</div>

Hi @[Alex\_MindStudio](https://community.mindstudio.ai/t/urgent-bug-report-critical-issue-with-publishing-agents-unexpected-token-export/1692/2),

Thanks for the quick response. The Agent ID is: 346179a6-28e3-4785-9a8d-8ad5570f9735

I’m happy to provide more details or screenshots if needed.

Best,

---

<div class="post-metadata">

**Author:** ![satya.k](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@satya.k](https://community.mindstudio.ai/u/satya.k)\
**Post date:** [October 7, 2025, 9:32am UTC](https://community.mindstudio.ai/t/urgent-bug-report-critical-issue-with-publishing-agents-unexpected-token-export/1692/4 "2025-10-07T09:32:45Z")

</div>

Hi @alex_mindstudio,  
Following up on this issue as I have shared the agent ID (The Agent ID is: 346179a6-28e3-4785-9a8d-8ad5570f9735) as requested. Could you let me know if there is any update on this issue. Hope you understand the urgency.

Thanks in advance,

satya.k

---

<div class="post-metadata">

**Author:** ![satya.k](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@satya.k](https://community.mindstudio.ai/u/satya.k)\
**Post date:** [October 9, 2025, 11:42am UTC](https://community.mindstudio.ai/t/urgent-bug-report-critical-issue-with-publishing-agents-unexpected-token-export/1692/5 "2025-10-09T11:42:38Z")

</div>

Hi MindStudio Community,

I’m writing to report a critical and urgent bug that is preventing me from publishing a production-ready agent. My workflow, which relies on a hybrid model of scripts and LLMs, functions perfectly in the “Open Draft Agent” environment but fails immediately upon publication. This is a complete blocker for deployment.

The Agent ID is: 346179a6-28e3-4785-9a8d-8ad5570f9735

The Core Problem:

The agent uses JavaScript Run Function blocks that require the Virtual Machine execution environment to import external libraries. While I’ve configured this setting in my draft, the platform is automatically reverting the environment to Sandbox mode during the publishing process.

This environment mismatch causes a fatal error: Unexpected token ‘export’ [: since the Sandbox environment does not support the export keyword used for module imports.

Additional Glitches:

Beyond the primary error, I’ve observed other nodes returning null outputs in the published version, which function correctly in the draft. This points to a deeper issue with how the agent’s state is handled upon publishing, suggesting a critical bug in the platform’s deployment logic.

This is an urgent matter as it makes my entire project unpublishable.

Steps to Reproduce:

1. Create an agent with a Run Function block that uses an external library and an export default statement.
2. Set the Run Function environment to Virtual Machine.
3. Confirm the workflow runs successfully in “Open Draft Agent”.
4. Publish the agent.
5. Execute the published agent. It will fail.

I am ready to provide screenshots of the working draft execution and the failing published run logs to help with the diagnosis.

I would greatly appreciate any immediate assistance or a workaround for this critical issue.

Thanks,

Satya.K

---

<div class="post-metadata">

**Author:** ![Alex\_MindStudio](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.mindstudio.ai/alex_mindstudio/32/27_2.png) [@Alex\_MindStudio](https://community.mindstudio.ai/u/Alex_MindStudio)\
**Post date:** [October 9, 2025, 1:40pm UTC](https://community.mindstudio.ai/t/urgent-bug-report-critical-issue-with-publishing-agents-unexpected-token-export/1692/6 "2025-10-09T13:40:56Z")

</div>

Hi @satya.k,

Thanks for sharing the Agent ID!

I ran a few tests on my end, but the issue didn’t come up. Could you record your screen to show the steps you’re taking and what happens when the issue appears? You can use this link:

> **[Click here to record your screen](https://recorder.jam.dev/sBPzZKg)**
>
> Easily record anything on your screen with Jam

Once you’ve recorded it, just reply here so we can take another look

---

<div class="post-metadata">

**Author:** ![satya.k](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@satya.k](https://community.mindstudio.ai/u/satya.k)\
**Post date:** [October 9, 2025, 2:06pm UTC](https://community.mindstudio.ai/t/urgent-bug-report-critical-issue-with-publishing-agents-unexpected-token-export/1692/7 "2025-10-09T14:06:58Z")

</div>

Hi @Alex_MindStudio , Thanks for your quick response. I’ve tested it, and it’s working fine as expected now. I’m not sure what caused the initial issue or how it was resolved, but I appreciate the fix.

---

<div class="post-metadata">

**Author:** ![Alex\_MindStudio](https://yyz2.discourse-cdn.com/flex008/user_avatar/community.mindstudio.ai/alex_mindstudio/32/27_2.png) [@Alex\_MindStudio](https://community.mindstudio.ai/u/Alex_MindStudio)\
**Post date:** [October 9, 2025, 2:11pm UTC](https://community.mindstudio.ai/t/urgent-bug-report-critical-issue-with-publishing-agents-unexpected-token-export/1692/8 "2025-10-09T14:11:17Z")

</div>

Hi @satya.k,

Glad to hear everything’s working as expected now!
