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

@jbrowse/img not working with "window" #4205

Closed
cmdcolin opened this issue Feb 15, 2024 · 3 comments · Fixed by #4208
Closed

@jbrowse/img not working with "window" #4205

cmdcolin opened this issue Feb 15, 2024 · 3 comments · Fixed by #4208
Labels
enhancement New feature or request

Comments

@cmdcolin
Copy link
Collaborator

[
  ReferenceError: window is not defined
      at getActiveElementDeep (/home/cdiesh/.fnm/node-versions/v20.10.0/installation/lib/node_modules/@jbrowse/img/node_modules/react-dom/cjs/react-dom.development.js:7766:13)
      at getSelectionInformation (/home/cdiesh/.fnm/node-versions/v20.10.0/installation/lib/node_modules/@jbrowse/img/node_modules/react-dom/cjs/react-dom.development.js:7800:21)
      at prepareForCommit (/home/cdiesh/.fnm/node-versions/v20.10.0/installation/lib/node_modules/@jbrowse/img/node_modules/react-dom/cjs/react-dom.development.js:10163:26)
      at commitRootImpl (/home/cdiesh/.fnm/node-versions/v20.10.0/installation/lib/node_modules/@jbrowse/img/node_modules/react-dom/cjs/react-dom.development.js:23085:29)
      at unstable_runWithPriority (/home/cdiesh/.fnm/node-versions/v20.10.0/installation/lib/node_modules/@jbrowse/img/node_modules/scheduler/cjs/scheduler.development.js:468:12)
      at runWithPriority$1 (/home/cdiesh/.fnm/node-versions/v20.10.0/installation/lib/node_modules/@jbrowse/img/node_modules/react-dom/cjs/react-dom.development.js:11276:10)
      at commitRoot (/home/cdiesh/.fnm/node-versions/v20.10.0/installation/lib/node_modules/@jbrowse/img/node_modules/react-dom/cjs/react-dom.development.js:22990:3)
      at performSyncWorkOnRoot (/home/cdiesh/.fnm/node-versions/v20.10.0/installation/lib/node_modules/@jbrowse/img/node_modules/react-dom/cjs/react-dom.development.js:22329:3)
      at scheduleUpdateOnFiber (/home/cdiesh/.fnm/node-versions/v20.10.0/installation/lib/node_modules/@jbrowse/img/node_modules/react-dom/cjs/react-dom.development.js:21881:7)
      at updateContainer (/home/cdiesh/.fnm/node-versions/v20.10.0/installation/lib/node_modules/@jbrowse/img/node_modules/react-dom/cjs/react-dom.development.js:25482:3)
]

from office hours, regarding auto-generating a bunch of screenshots

@cmdcolin cmdcolin added the enhancement New feature or request label Feb 15, 2024
@cmdcolin
Copy link
Collaborator Author

not sure what last working version was

@cmdcolin
Copy link
Collaborator Author

there is a sort of interesting reason for error....

the jbrowse-img tests try to force jest to run in the node environment instead of jsdom (browser-like) environment since it is a command line node tool, but this was not working because the code looked like this

/* eslint-disable tsdoc/syntax */ 
/**
 * @jest-environment node
 */

it was not using the node environment in this case

deleting the eslint-disable makes it work

@cmdcolin
Copy link
Collaborator Author

might be related to our existing eslint carve out here

{
      files: [
        '**/jbrowse-cli/**/*.test.ts',
        '**/jbrowse-cli/**/*.test.tsx',
        '**/jbrowse-img/**/*.test.ts',
      ],
      rules: {
        'tsdoc/syntax': 'off',
      },
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant