You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting the error when trying to import a library in my code using the following syntax
import {
SomeObject
} from 'library';
the error looks like this:
node:internal/modules/cjs/loader:1150
throw err;
^
Error [ERR_REQUIRE_ESM]: require() of ES Module <Folder where notebook is located>/node_modules/<library>/dist/index.js from <Folder where notebook is located>/src.js not supported.
Instead change the require of index.js in <Folder where notebook is located>/src.js to a dynamic import() which is available in all CommonJS modules.
at Object.apply (/usr/local/lib/node_modules/tslab/dist/executor.js:63:24)
at evalmachine.<anonymous>:22:26
at evalmachine.<anonymous>:25:3
at sigintHandlersWrap (node:vm:268:12)
at Script.runInThisContext (node:vm:127:14)
at Object.runInThisContext (node:vm:305:38)
at Object.execute (/usr/local/lib/node_modules/tslab/dist/executor.js:162:38)
at JupyterHandlerImpl.handleExecuteImpl (/usr/local/lib/node_modules/tslab/dist/jupyter.js:219:38)
at /usr/local/lib/node_modules/tslab/dist/jupyter.js:177:57
at async JupyterHandlerImpl.handleExecute (/usr/local/lib/node_modules/tslab/dist/jupyter.js:177:21)
at async ZmqServer.handleExecute (/usr/local/lib/node_modules/tslab/dist/jupyter.js:375:25)
at async ZmqServer.handleShellMessage (/usr/local/lib/node_modules/tslab/dist/jupyter.js:320:21) {
code: 'ERR_REQUIRE_ESM'
}
If that is a problem with my library and not with tslab kernel itself, could you tell me what it is?
Did you figure it out? I'm expecting that tslab is wrapping around node and doesn't support esm and maybe something like this could work https://github.com/standard-things/esm
I'm getting the error when trying to import a library in my code using the following syntax
the error looks like this:
If that is a problem with my library and not with
tslab
kernel itself, could you tell me what it is?Node - 16.7.0
jupyter --version
OS - MacOS Monterey 12.4
The text was updated successfully, but these errors were encountered: