zsviczian / obsidian-excalidraw-plugin

A plugin to edit and view Excalidraw drawings in Obsidian
4.33k stars 233 forks source link

Build errors #1210

Open Dreamer2048 opened 1 year ago

Dreamer2048 commented 1 year ago

Hello, When trying to modify excalidraw, I got an error: Here it is:

E:\Sources\obsidian>yarn run dev
yarn run v1.22.19
$ cross-env NODE_ENV=development rollup --config rollup.config.js -w
[!] Error: Cannot find module 'E:\Sources\obsidian\node_modules\rollup-plugin-postprocess\dist\rollup-plugin-postprocess.js'. Please verify that the package.json has a valid "main" entry
Error: Cannot find module 'E:\Sources\obsidian\node_modules\rollup-plugin-postprocess\dist\rollup-plugin-postprocess.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (node:internal/modules/cjs/loader:353:19)
    at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (E:\Sources\obsidian\rollup.config.js:18:19)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.require.extensions.<computed> [as .js] (E:\Sources\obsidian\node_modules\rollup\dist\shared\loadConfigFile.js:621:20)
    at Module.load (node:internal/modules/cjs/loader:981:32)

How could dist\rollup-plugin-postprocess.js exist? It was listed in .gitignore. For the nonexistence it should be, I created one with a blank file in that directory. But more unexpectedly, another error :

[!] TypeError: postprocess__default.default is not a function
TypeError: postprocess__default.default is not a function
    at Object.<anonymous> (E:\Sources\obsidian\rollup.config.js:102:38)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.require.extensions.<computed> [as .js] (E:\Sources\obsidian\node_modules\rollup\dist\shared\loadConfigFile.js:621:20)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at loadConfigFromBundledFile (E:\Sources\obsidian\node_modules\rollup\dist\shared\loadConfigFile.js:631:42)
    at getDefaultFromTranspiledConfigFile (E:\Sources\obsidian\node_modules\rollup\dist\shared\loadConfigFile.js:613:12)
    at loadConfigFile (E:\Sources\obsidian\node_modules\rollup\dist\shared\loadConfigFile.js:572:11)
zsviczian commented 1 year ago

read the comments in the rollup.json

https://github.com/zsviczian/obsidian-excalidraw-plugin/blob/d82815c56a3c11058e3d04b13ae4447a37775272/rollup.config.js#L76-L79

Dreamer2048 commented 1 year ago

Having been read before, I got another error like this:

npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/brettz9/rollup-plugin-postprocess.git
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.

while yarn installed it successfully ,it failed to build. Node version: v16.10.0-x64

zsviczian commented 1 year ago

I build the Obsidian plugin with npm run build