GordonSmith / vscode-ojs

VS Code extension for ObservableHQ notebooks
https://marketplace.visualstudio.com/items?itemName=GordonSmith.observable-js
MIT License
58 stars 5 forks source link

"Failed to fetch" error when importing within .ojsnb after VSCode restart #55

Open Korolen opened 1 year ago

Korolen commented 1 year ago

Hi,

Absolutely loving this library, overall; thank you -- Observable is amazing, but it's a dealbreaker to not be able to use my local tools, so this fills a real gap.

I'm having a hangup trying to import one file from another .ojsnb file. Everything works as expected when viewing the importing notebook through the preview window (Cmd+K V), but when running the cells in the notebook view, it only works until I close and restart VSCode. After a restart, the importing .ojsnb file simply outputs "Failed to fetch", with the quotes, as the output of the import line when running the cells. (other lines in the cell up to the import line run normally, nothing after.)

The issue is reproducible for me with vscode-ojs/samples/myMain.ojs that imports from ./myLib.ojs, converted to a .ojsnb file. (it also reproduces with a fully simplified version of them.)

Any insight into what's causing this behavior, and how to fix it?

I'd be happy to perform any actions you might request of me, let me know.

GordonSmith commented 1 year ago

Do you have a small example of it not working to get me started? - Just to clarify import is working fine with ojs/omd but not working as expected when used within an ojsnb file? Is it:

  1. ojsnb importing ojs file?
  2. ojsnb importing from ojsnb file?

Or a different combination (thx for the report)?