Imports could not be resolved: is there a memory limit?

Heya,

I’m still working on a workflow for a bibliography. I’ve moved this to a separate document with the howto steps, and was hoping to import this as a single variable for tidyness.

However, importing formattedBibliography into another document doesn’t give the right formatting, and ignores my custom CSL entirely. Importing it as HTML as exportedBibliography gives the error RuntimeError: exportedBibliography could not be resolved. I’m using import { formattedBibliography, exportedBibliography } from "@resistancelab/taser-report-bibliography" to test this.

I’m aware the CSL import is very long and requires a notebook reload so this is the main thing I have my eye on but it would be great to get some clarity here on why it’s not working and/or get some better error messages.

Thanks a lot!

Likely because the cell does not exist in the published version of your notebook. Did you publish your latest changes?

I’ve also noticed that you’re modifying the config cell within another unnamed cell:

config.templates.add('md', csl)

This cell won’t execute unless you also explicitely import it. I’d recommend adding the line directly to your config cell.

Worth mentioning is that a link to a shared notebook also works (if you don’t want to publish the notebook)

Thanks for this! I didn’t know I had to republish, glad to find this now :slight_smile:

This cell won’t execute unless you also explicitely import it. I’d recommend adding the line directly to your config cell.

I’ve attempted to do this (chained methods, importing config into destination doc) but still not working - is my current method correct?

Thanks for the support!

Not quite. Previously I assumed that config was something that you pass around or reference, but that doesn’t seem to be the case. Instead it’s merely a way for you to modify the Cite object. If I were to import formattedBibliography without also importing config, I’d still be missing the md template.

I’d recommend to perform your initialization before returning the Cite object:

Cite = {
  const Cite = await require('https://bundle.run/citation-js@0.5.0-alpha.5');
  Cite.plugins.config.get('@csl').templates.add('md', csl);
  return Cite;
}

Then importing formattedBibliography will work on its own.

Apols for delay, that worked great thankyou!!! Love the support on this forum :star_struck:

1 Like