Can't use fs or fs/promises in plugin. Getting the following error
ERROR in ./dist/index.js
Module not found: Error: Can't resolve 'fs' in '/home/nishantwrp/dev/misc/template-plugin-prototype/dist'
@ ./dist/index.js 1:9350-9363
Can't use fs or fs/promises in plugin. Getting the following error
ERROR in ./dist/index.js
Module not found: Error: Can't resolve 'fs' in '/home/nishantwrp/dev/misc/template-plugin-prototype/dist'
@ ./dist/index.js 1:9350-9363
You need to use joplin.plugins.require('fs')
Thanks, got it.
UPDATE: I tried to use it. And I am getting the following error.
Property 'require' does not exist on type 'JoplinPlugins'.ts(2339)
Apparantely the type declarlations for this api may be not present.
/cc @roman_r_m
Thanks, maybe we can create a separate github issue to keep track of it?
There's one already (mentioned in the linked topic)
Ah, sorry missed it.
By the way joplin.plugins.require
is deprecated - it should now be joplin.require