Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix undefined window error in logger #1897

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

faridyagubbayli
Copy link
Contributor

Context

Logger accesses window object which can be undefined if used in wasm worker. For example, check the Volume Labelmap to Surface example - segment some part and try to convert the labelmap to surface segmentation, you'll get the error below:

Uncaught (in promise) ReferenceError: window is not defined

Changes & Results

Added check for undefined window. If window is undefined, then skip setting the log level.

Testing

Tested by running the example mentioned above and making sure it runs correctly.

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • [] My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] "OS:
  • [] "Node version:
  • [] "Browser:

Copy link

netlify bot commented Mar 12, 2025

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit d889c1a
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/67d1f8e1d7885100089007f7
😎 Deploy Preview https://deploy-preview-1897--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@sedghi sedghi merged commit a142cdd into cornerstonejs:main Mar 13, 2025
10 of 11 checks passed
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.

2 participants