New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@rollup/plugin-json error using @argdown-node #222
Comments
Hi, this seems to be an issue of bundling axios with rollup. I would first search for similar issues in the rollup and axios repositories (a quick search brought up some results). It seems as if Rollup is trying to import the package.json of Axios instead of the package's entry point, which is strange. As a workaround you could import the Argdown app from the import {argdown} from "@argdown/core"; It is not as powerful as the node version, but many features will still work (it is used in the Sandbox and the Argdown preview of the VSCode extension). |
Great thanks! I seemed to solve that issue, but now I get a runtime error both when I use argdown-node and argdown-core. When using argdown-node this error appears:
And when using argdown-core I get this:
I am using windows, so I don't know why fsevents should even be involved. Is it related to this?: #104 I looked in package-lock.json and both fsevents and mdurl are in there. fsevents is marked optional too... Do you have any thoughts? Thanks for the help! (edit: fixed codeblock, typo) |
Hi @amdecker, |
thanks for your help, I'll try again later today or tomorrow and see how things go and let you know -- so for now could you leave it open? |
I'm still running into the same fsevents error as before. It looks like electron (obsidian is an electron app) does not play well with fsevents paulmillr/chokidar#618 and fsevents/fsevents#131. However the fix described in those issues requires bundling fsevents with the electron app, which I can't do because obsidian is not open source. Is it possible to use argdown without any reference to fsevents? Is it possible that fsevents is not correctly labelled as optional somewhere? One hacky solution would be to have users install the argdown cli and then run exec from within my plugin, but if I can use the argdown/node or core package, that would be ideal. I am thoroughly stuck, so if you have any ideas, let me know -- though if this doesn't interest you or you simply don't have the time, that's perfectly ok. |
I do not use fsevents directly, only through Chokidar. Chokidar is used in the AsyncArgdownApplication of
|
I haven't been able to figure it out, so I went with depending on users installing argdown-cli for now. |
Hi,
I'm trying to write a plugin for Obsidian using @argdown-node. I added
import {argdown} from "@argdown/node";
andconsole.log(argdown);
to the sample Obsidian plugin after runningnode install @argdown/node --save-dev
and I got this error. Has anyone used @argdown-node before and have any tips for getting it up and running?Here is the error I received:
[!] Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON files) node_modules\axios\package.json (2:9) 1: { 2: "_from": "axios@^0.21.1", ^ 3: "_id": "axios@0.21.1", 4: "_inBundle": false, Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON files) at error (C:\Users\adder\Documents\obsidian-notes\.obsidian\plugins\obsidian-argdown-plugin\node_modules\rollup\dist\shared\rollup.js:5305:30) at Module.error (C:\Users\adder\Documents\obsidian-notes\.obsidian\plugins\obsidian-argdown-plugin\node_modules\rollup\dist\shared\rollup.js:9750:16) at Module.tryParse (C:\Users\adder\Documents\obsidian-notes\.obsidian\plugins\obsidian-argdown-plugin\node_modules\rollup\dist\shared\rollup.js:10156:25) at Module.setSource (C:\Users\adder\Documents\obsidian-notes\.obsidian\plugins\obsidian-argdown-plugin\node_modules\rollup\dist\shared\rollup.js:10057:24) at ModuleLoader.addModuleSource (C:\Users\adder\Documents\obsidian-notes\.obsidian\plugins\obsidian-argdown-plugin\node_modules\rollup\dist\shared\rollup.js:18396:20) at async ModuleLoader.fetchModule (C:\Users\adder\Documents\obsidian-notes\.obsidian\plugins\obsidian-argdown-plugin\node_modules\rollup\dist\shared\rollup.js:18452:9) at async Promise.all (index 9) at async ModuleLoader.fetchStaticDependencies (C:\Users\adder\Documents\obsidian-notes\.obsidian\plugins\obsidian-argdown-plugin\node_modules\rollup\dist\shared\rollup.js:18478:34) at async Promise.all (index 0) at async ModuleLoader.fetchModule (C:\Users\adder\Documents\obsidian-notes\.obsidian\plugins\obsidian-argdown-plugin\node_modules\rollup\dist\shared\rollup.js:18454:9)
The text was updated successfully, but these errors were encountered: