Skip to content

Commit ebdd93a

Browse files
committed
Fix avoid upstream typechecking issue
Running `npm install` with the JupyterLab 2.0.0 dependencies resulted in an error. ``` node_modules/@jupyterlab/ui-components/lib/icon/labicon.d.ts:3:8 - error TS1259: Module '"/home/erik/dev/contrib/jupyterhub/jupyter-server-proxy/jupyterlab-server-proxy/node_modules/@types/react/index"' can only be default-imported using the 'esModuleInterop' flag 3 import React from 'react'; ~~~~~ node_modules/@types/react/index.d.ts:62:1 62 export = React; ~~~~~~~~~~~~~~~ This module is declared with using 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. ``` Adding an option that influenced the typechecking, but not the actual execution, made it go away. I learned it from this stackoverflow answer. https://stackoverflow.com/a/56348146/2220152 Note that the option `allowSyntheticDefaultImports` is described like this, which makes me safe that we won't influence actual execution but only the type checking part. > Allow default imports from modules with no default export. This does not affect code emit, just typechecking.
1 parent f9c8c7f commit ebdd93a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

jupyterlab-server-proxy/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"compilerOptions": {
3+
"allowSyntheticDefaultImports": true,
34
"declaration": true,
45
"lib": ["es2015", "dom"],
56
"module": "commonjs",

0 commit comments

Comments
 (0)