tiddly-gittly / TidGi-Desktop

TidGi is an privacy-in-mind, automated, auto-git-backup, freely-deployed knowledge management Desktop note app, based on Tiddlywiki, with REST API for web-clipping and Anki connect. 「 太记 」是一个基于「 太微 TiddlyWiki 」的知识管理桌面应用,能保护隐私内容、高级自动化、自动Git云备份、部署为博客,且可通过RESTAPI与Anki等应用连接。(迭代开发中欢迎试用,开发进度见下方链接)(Under active development, see website below for details)
https://tidgi.fun
Mozilla Public License 2.0
1.71k stars 106 forks source link

Error: Cannot find module '$:/plugins/kixam/moment/moment.js' #414

Closed dongrentianyu closed 1 year ago

dongrentianyu commented 1 year ago

Environment

TidGi 0.8.0-prerelease9 Electron 24.3.1 win32 10.0.22621 Locale: zh-CN

Description:

Steps to Reproduce:

Additional Context

Error: Error executing boot module $:/plugins/kixam/datepicker/widget.datepicker.js: {"code":"MODULE_NOT_FOUND","requireStack":["C:\\Users\\34656\\AppData\\Local\\tidgi\\app-0.8.0-prerelease9\\resources\\app.asar.unpacked\\.webpack\\main\\543.index.worker.js"]}

Error: Cannot find module '$:/plugins/kixam/moment/moment.js'
Require stack:
- C:\Users\34656\AppData\Local\tidgi\app-0.8.0-prerelease9\resources\app.asar.unpacked\.webpack\main\543.index.worker.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1054:15)
    at Module._load (node:internal/modules/cjs/loader:900:27)
    at Function.f._load (node:electron/js2c/asar_bundle:2:13330)
    at Module.require (node:internal/modules/cjs/loader:1120:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.t.modules.execute (C:\Users\34656\AppData\Local\tidgi\app-0.8.0-prerelease9\resources\app.asar.unpacked\.webpack\main\543.index.worker.js:2:11822)
    at require (C:\Users\34656\AppData\Local\tidgi\app-0.8.0-prerelease9\resources\app.asar.unpacked\.webpack\main\543.index.worker.js:2:11409)
    at $:/plugins/kixam/datepicker/widget.datepicker.js:36:16
    at $:/plugins/kixam/datepicker/widget.datepicker.js:255:1
    at $:/plugins/kixam/datepicker/widget.datepicker.js:257:4

    at Object.next (C:\Users\34656\AppData\Local\tidgi\app-0.8.0-prerelease9\resources\app.asar\.webpack\main\index.js:2:1981296)

5a9KfOUHFUYFVE57xNNmi.log fortidgit.log

好像人是意义之塔插件导致的。

linonetwo commented 1 year ago

就是那个没递归装依赖的问题,可以给核心提issue,练练英文

dongrentianyu commented 1 year ago

但是那个插件依赖了这个插件呢?我只看到project插件依赖了这个插件,而且后面也移除了。

dongrentianyu commented 1 year ago

另一个是,我删除这两个插件后,在本地是可以正常运行的。所以我在想是不是不需要依赖这两个插件?

linonetwo commented 1 year ago

itkg - calendar - pikaday - moment

dongrentianyu commented 1 year ago

哦,怪不得日历插件老装不上去。原来是日历插件里面有依赖两个插件。但我们不可以把书这两个插件也放到意义之塔里吗?也就是把其他插件的依赖插件也一并写上。虽然这样可能不够有效。但好像也是一种办法。

dongrentianyu commented 1 year ago

这依赖插件递归的。好吧,比我想的要长。

dongrentianyu commented 1 year ago

我试着去提一下吧,不过估计是用deepl翻译的。自己写估计写不完了。

dongrentianyu commented 1 year ago

好像不用提,我在一个issue里发现了杰里米的回复是这样的。

https://github.com/Jermolene/TiddlyWiki5/commit/e752ba7c6abcdde229258aa1562e6de518c3556e

<$set name="url" value={{!!url}}>
<$set name="currentTiddler" value=<<assetInfo>>>
<$list filter="[enlist{!!dependents}] [{!!parent-plugin}] +[sort[title]]" variable="dependency">
<$action-sendmessage $message="tm-load-plugin-from-library" url=<<url>> title=<<dependency>>/>
</$list>
</$set>
</$set>

这段代码里好像有在处理这个问题。

linonetwo commented 1 year ago

但问题还在嘛,估计它只处理了一层的情况

dongrentianyu commented 1 year ago

先放着,等考完试再来搞。我看着好像确实挺复杂的。而且解决办法应该也有。

目前想到的解决办法有

上述检查完了再看要不要提issue讨论。

dongrentianyu commented 1 year ago

先不急着修复好了。不然匆忙修改,回头还要改过来。群里有人报错就说一声好了。

dongrentianyu commented 1 year ago

这个东西比我想象的要有难度。

image

官方文档里说明了不进行递归解析。我在想是做不到递归解析,还是考虑到递归解析会有什么安全问题,然后不进行递归解析?

linonetwo commented 1 year ago

你提个 issue 问问呗,大不了自问自答,但是问了再说

linonetwo commented 1 year ago

这个功能还是在官方仓库 issue 跟踪吧,我这就先关了,你可以把那边的 issue 链接贴过来

dongrentianyu commented 1 year ago

嗯,我发现有一些问题他们可能没有考虑到,比如依赖插件的版本控制,像aggregation插件应该0.5.0版本,然后提示应该要安装更高级版本的了。

linonetwo commented 1 year ago

这也是为啥他们一直没搞出 CPL,我们搞出来了

dongrentianyu commented 1 year ago

这个问题还是交由他们解决吧。回头我提个pr,把这些依赖插件先写上,不然新用户一装这个插件就打不开,然后报错,就麻烦了。

dongrentianyu commented 1 year ago

应该只有这两个吧,"$:/plugins/kixam/datepicker","$:/plugins/kixam/moment",我看报错应该只有这些。