Definitelytyped: @types/codemirror/index has no default export

Created on 14 Nov 2018  路  2Comments  路  Source: DefinitelyTyped/DefinitelyTyped

Hi, I am trying to use the CodeMirror typings in a JupyterLab extension, however, I cannot compile my extension, because of the typings not having default export, according to tsc:

node_modules/@jupyterlab/codemirror/lib/editor.d.ts:1:8 - error TS1192: Module '"/home/user/development/jupyterlab-extensions/jupyterlab-cell-scanner/node_modules/@types/codemirror/index"' has no default export.

1 import CodeMirror from 'codemirror';
         ~~~~~~~~~~

This did not happen before, so I think it might be because of a change in the typings.

Most helpful comment

In the end I added a tsconfig.json compiler option to allow synthetic default imports:

allowSyntheticDefaultImports: true.

All 2 comments

Have you tried import * as CodeMirror from 'codemirror';

In the end I added a tsconfig.json compiler option to allow synthetic default imports:

allowSyntheticDefaultImports: true.

Was this page helpful?
0 / 5 - 0 ratings