Can't use fs or fs/promises in plugin

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')

1 Like

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

1 Like

Thanks, maybe we can create a separate github issue to keep track of it?

There's one already (mentioned in the linked topic)

1 Like

Ah, sorry missed it.

By the way joplin.plugins.require is deprecated - it should now be joplin.require

1 Like