You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
index.js (It is a copy of example code in README.md)
import{Notebook}from"crossnote";asyncfunctionmain(){constnotebook=awaitNotebook.init({notebookPath: "/absolute/path/to/your/notebook",config: {previewTheme: "github-light.css",mathRenderingOption: "KaTeX",codeBlockTheme: "github.css",printBackground: true,enableScriptExecution: true,// <= For running code chunks.},});// Get the markdown engine for a specific note file in your notebook.constengine=notebook.getNoteMarkdownEngine("README.md");// open in browserawaitengine.openInBrowser({runAllCodeChunks: true});// html exportawaitengine.htmlExport({offline: false,runAllCodeChunks: true});// chrome (puppeteer) exportawaitengine.chromeExport({fileType: "pdf",runAllCodeChunks: true});// fileType = 'pdf'|'png'|'jpeg'// prince exportawaitengine.princeExport({runAllCodeChunks: true});// ebook exportawaitengine.eBookExport({fileType: "epub"});// fileType = 'epub'|'pdf'|'mobi'|'html'// pandoc exportawaitengine.pandocExport({runAllCodeChunks: true});// markdown(gfm) exportawaitengine.markdownExport({runAllCodeChunks: true});returnprocess.exit();}main();
Running index.js, ERR_MODULE_NOT_FOUND occurs.
$ node index.jsnode:internal/modules/run_main:129 triggerUncaughtException( ^Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/frozenbonito/crossnote-repro/node_modules/bit-field/lib/render' imported from /home/frozenbonito/crossnote-repro/node_modules/crossnote/out/esm/index.mjsDid you mean to import "bit-field/lib/render.js"? at finalizeResolution (node:internal/modules/esm/resolve:265:11) at moduleResolve (node:internal/modules/esm/resolve:933:10) at defaultResolve (node:internal/modules/esm/resolve:1157:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38) at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39) at link (node:internal/modules/esm/module_job:86:36) { code: 'ERR_MODULE_NOT_FOUND', url: 'file:///home/frozenbonito/crossnote-repro/node_modules/bit-field/lib/render'}Node.js v20.15.0
Expected behavior
It succeeds.
The text was updated successfully, but these errors were encountered:
Describe the bug
An error occurs when importing crossnote in ESM.
Environment
To Reproduce
index.js (It is a copy of example code in README.md)
Running
index.js
,ERR_MODULE_NOT_FOUND
occurs.Expected behavior
It succeeds.
The text was updated successfully, but these errors were encountered: