View in #help on Slack
@Parikshit_Prasai: Hi, I was trying to create custom mode and extension for the Viewer.
I used the CLI to create and link a mode.
The mode works fine, as it is displayed in the Mode select
. Accessing the mode through URL also works as expected.
However, the problem arises when I link an extension. After linking, I included the new extension in the custom mode like so:
const extensionDependencies = {
'@ohif/extension-default': '^3.0.0',
'@ohif/extension-cornerstone': '^3.0.0',
loginExt: '0.0.1', # custom extension that is linked by CLI
};
Now, study list does not open with following error logged in the console (I have included a screenshot as well):
Cannot find module 'loginExt
The loginExt
extension is registered in the pluginConfig
, and the name in its package.json
is loginExt
as well.
@Alireza_Sedghi: how did you link the extension?
check if platform/app/pluginConfig.json has your new loginExt
(you shouldn’t touch that file though manually)
something else you might need to do is to check your package.json and add your dependency on that extension
(i’m not sure if cli handles that)
@Parikshit_Prasai: Thank you so much! Things are working well now after adding the dependency in the mode’s package.json as per your suggestion. Your suspicion regarding CLI not adding peer dependency in the package.json file is indeed correct.