Mode / Extension Development Process

Hi! I am trying to author a new Mode and a new Extension for OHIF v3 by following the documentation. I’ve used the CLI to create the mode and the extension, and I’ve linked them (using the CLI)into a local copy of OHIF v3.

I am running into trouble getting started with development, as I am receiving errors related to module/type resolution for my dependencies. I suspect there is a recommended workflow for developing Modes and Extensions for OHIF, but I do not see reference to a preferred workflow in the docs. For someone coming to OHIF v3 for the first time, does anyone have tips for getting started (e.g. configuring a development environment) developing Modes and Extensions?

Here is one example of what I’m running up against:

import React              from 'react';
import { ToolbarButton }  from '@ohif/ui';

const MyToolbarButton = () => {
  return (
    <ToolbarButton icon="tool-zoom" id="my-zoom" label="zoom" type="tool" />

export default MyToolbarButton;

In the above example, I am receiving errors:

  • Cannot find module 'react' or its corresponding type declarations.ts(2307)
  • Cannot find module '@ohif/ui' or its corresponding type declarations.ts(2307)

Does the generated Mode/Extension require further configuration to make types available?

Thanks so much for your help!

create-react-app or npm i react
npm i @ohif/viewer