Building syncadaptor plugin : No build error but 'require' seems not resolved by browserify

30 views
Skip to first unread message

alain.bo...@gmail.com

unread,
Dec 23, 2018, 3:20:01 PM12/23/18
to TiddlyWikiDev
I am using node.js 8.9.4 on a synology.

I am developing a syncadaptor plugin to connect Tiddlywiki wtith a node-solid-server.
I take inspiration from the plugin developped for RemoteStorage https://github.com/fiatjaf/tiddlywiki-remotestorage/blob/master/README.md
I try it and it works https://tiddly.alhur.es/

I finished my code on https:https://github.com/bourgeoa/tiddlywiki-node-solid-server/blob/master/package.json and was going to test it.
I build it following the process described in Scripts for building tiddlywiki.com find in https://tiddlywiki.com/dev/

I also build the original remotestorage plugin and got the exact same problem.

As a results with both plugin : remotestorage and min note-solid-server :
- both build without error
- when I use the produced index.html both give error due to unresolved require for the module name 'remotestorage' in one case and 'node-solid-server' in the other case


Internal JavaScript Error

Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser
uncaught exception: Cannot find module named 'remotestoragejs' required by module '$:/plugins/tiddlywiki/remotestorage/syncadaptor.js', resolved to remotestoragejs

Could someone help ?
I saw something on babelify don't know how to do ?

alain.bo...@gmail.com

unread,
Dec 24, 2018, 4:02:24 PM12/24/18
to TiddlyWikiDev
Solved.
I needed to understand the process of making my .js file browser compatible.
So before building the plugin for TW5, had to:
- npm install : create a node-modules folder with all the dependencies
- browserify the resulting .js file and node-modules folder. This is done with a script in package.json. The script being by nmpm run <script name>

May be it could be of interest to update the dev documentation with some comment on resolving dependencies (npm install) and browserify (npm run <script>).

Reply all
Reply to author
Forward
0 new messages