Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

How the feature works? / How did you fix the issue?

Explicit hydrogens toggle inside the monomer creation wizard could throw process is not defined, interrupting removal of leaving groups while keeping hydrogen atoms. The crash stemmed from a standalone worker path referencing process in browser context.

  • Runtime guard for standalone Indigo callback
    • Ensure process is checked before accessing process.env to avoid browser-side ReferenceError.
const isSeparateRender =
  typeof process !== 'undefined' && process.env?.SEPARATE_INDIGO_RENDER;

Check list

  • unit-tests written
  • e2e-tests written
  • documentation updated
  • PR name follows the pattern #1234 – issue name
  • branch name doesn't contain '#'
  • PR is linked with the issue
  • base branch (master or release/xx) is correct
  • task status changed to "Code review"
  • reviewers are notified about the pull request
Original prompt

This section details on the original issue you should resolve

<issue_title>Add/Remove explicit hydrogens operation inside create monomer wizard causes exception: process is not defined</issue_title>
<issue_description>Steps to Reproduce

  1. Open Molecules canvas
  2. Paste followng molecule on the canvas: CCCP%91(N)(O)C.[*:1]%91 |$;;;;;;;_R1$|
Image
  1. Select whole molecule and press Create a monomer button
Image
  1. Press Add/Remove explicit hydrogens button twice

Actual behavior
System throws exception: process is not defined
Image

Expected behavior
No exception, R1 leaving group removed but H atom remains
Image

Comment from the developer: need to try using atoms mapping before sending to indigo

Environment details:

  • Ketcher Version 3.11.0-rc.1 2025-11-27; 18:06:40
  • Indigo Version 1.39.0-rc.1.0-gddb882b27-wasm32-wasm-clang-19.0.0
  • Chrome Version 142.0.7444.176 (Official Build) (64-bit)
  • Win10</issue_description>

Comments on the Issue (you are @copilot in this section)

@rrodionov91 need to try using atoms mapping before sending to indigo

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix exception when adding/removing explicit hydrogens in monomer wizard Prevent process reference crash during explicit hydrogen toggle in monomer wizard Jan 31, 2026
Copilot AI requested a review from AlexeyGirin January 31, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add/Remove explicit hydrogens operation inside create monomer wizard causes exception: process is not defined

2 participants