Can a class defined in a notebook be imported?

It’s not clear from the Introdution to Imports discussion if an import of the following class into another notebook should work-or-not:

Import Syntax:

import {bezierPath} from “

Error being generated is: TypeError: errorloading dynamically imported module

In your import statement, you only need to include the notebook id (the “@user/notebook” part), and not the entire link. This alone should work:

import {bezierPath} from "@mariodelgadosr/animated-three-js-3d-quadratic-bezier-curves"


1 Like

To add to that, you can import from a URL, but for notebooks on you have to use the link:

import { bezierPath } from ""



If I’m not mistaken you can only import from Observable notebooks, because import only mimics static imports and is parsed/transpiled by Observable - correct?

Yes, that’s correct. To be precise, you’re not importing the notebook directly, but rather the compiled Observable v3 module. And any v3 module file can be imported, it doesn’t have to be hosted at