wolfram-notebook-embedder icon indicating copy to clipboard operation
wolfram-notebook-embedder copied to clipboard

Improve package loading compatibility in documentation

Open portokallidis opened this issue 4 years ago • 3 comments

In some cases the import fails when trying to use the default export so its better if you also include aliases in the docs. import * as WolframNotebookEmbedder from 'wolfram-notebook-embedder'

portokallidis avatar Jul 08 '21 13:07 portokallidis

Any chance you could point us to a full example that demonstrates the failing import?

poeschko avatar Oct 02 '21 11:10 poeschko

Sure, here is a typical vanilla js project with a bundler. https://codesandbox.io/s/wolfram-notebook-embedder-import-demo-o2wv7?file=/src/index.js

You can switch 3rd and 4th line to see what i mean.

portokallidis avatar Oct 02 '21 15:10 portokallidis

Thank you!

I'm adding a default export as a courtesy, but also changing the documentation to encourage the named import (import * as WolframNotebookEmbedder or import {embed}).

poeschko avatar Oct 04 '21 09:10 poeschko