Skip to content

Commit

Permalink
Catch useLayoutEffect warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Mar 14, 2022
1 parent 10d4b29 commit 8cb0ed5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion products/jbrowse-img/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import { standardizeArgv, parseArgv } from './parseArgv'
import { renderRegion } from './renderRegion'
import tmp from 'tmp'
import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'

import { spawnSync } from 'child_process'

const err = console.error
console.error = (...args) =>
args[0]?.match('useLayoutEffect') ? null : err(args)

// eslint-disable-next-line no-unused-expressions
yargs
.command('jb2export', 'Creates a jbrowse 2 image snapshot')
Expand Down Expand Up @@ -184,6 +187,10 @@ time(async () => {
} else {
fs.writeFileSync(outfile, result)
}

// manually exit the process after done rendering because autoruns or
// something similar otherwise keeps the nodejs process alive xref
// https://github.com/GMOD/jb2export/issues/6
process.exit(0)
} catch (e) {
console.error(e)
Expand Down

0 comments on commit 8cb0ed5

Please sign in to comment.