I'm creating an "anywidget" to access some hardware devices known as "Phidgets."
This requires importing a library of js code in the _esm file for the anywidget.
My import statement works fine in Jupyter Lab, but not in Jupyter Hub (the classic Jupyter notebook).
My question is: what is the proper way to import a js module into the _esm file?
This statement works in Jupyter Lab, but not in Hub (i.e. not in classic notebook):
_esm = """
import "https://unpkg.com/phidget22/browser/phidget22";
....
I've also tried the following, based on the examples in the anywidget docs:
import * as phidget22 from "https://unpkg.com/phidget22/browser/phidget22"; or
import USBConnection from "https://unpkg.com/phidget22/browser/phidget22";
But they don't work at all. So, what is the right way to import?
I'm creating an "anywidget" to access some hardware devices known as "Phidgets."
This requires importing a library of js code in the _esm file for the anywidget.
My import statement works fine in Jupyter Lab, but not in Jupyter Hub (the classic Jupyter notebook).
My question is: what is the proper way to import a js module into the _esm file?
This statement works in Jupyter Lab, but not in Hub (i.e. not in classic notebook):
_esm = """
import "https://unpkg.com/phidget22/browser/phidget22";
....
I've also tried the following, based on the examples in the anywidget docs:
import * as phidget22 from "https://unpkg.com/phidget22/browser/phidget22"; or
import USBConnection from "https://unpkg.com/phidget22/browser/phidget22";
But they don't work at all. So, what is the right way to import?