"Cannot find module" error on custom plugin
-
Hi everybody, I have a nodebb forum (v13.12.3) on which I try to develop a RPG plugin. I splitted the feature in many plugins for developpement and I'm currently trying to implement the first part of my plugin. I can access the page on my ACP but I see in console a module error (so buttons will not work and I can't do anything)
admin.min.js?v=1bd513b5a7d:1 error loading admin/characters-core
Error: Cannot find module './characters-core'
at https://inquisitionem.fr/assets/admin.min.js?v=1bd513b5a7d:1:20778
at async w (https://inquisitionem.fr/assets/admin.min.js?v=1bd513b5a7d:1:33907)
at async Promise.all (index 0)
at async app.require (https://inquisitionem.fr/assets/admin.min.js?v=1bd513b5a7d:2:54)
at async https://inquisitionem.fr/assets/admin.min.js?v=1bd513b5a7d:1:27585I tried to restart from scratch but each time I face this error. I miss a point with modules but I can't find where so I ask your help.
You can find the code here: https://github.com/Bassaltent/characters-core
Thx by advance for helping me
-
Thanks a lot for your answer.
I've checked the quickstart plugin repo and updated my plugin.json and admin.js accordingly (at least I think) to the quickstart plugin and added some acp related files as described in the example but I have still the same error.
I miss something (and/or I'm dumb)
-
If you move the template to
admin/plugins/characters-core.tpl
and render it withres.render('admin/plugins/characters-core', {});
it should work.The client side uses the path passed to
res.render
to import the module so in this case it needs to match the path you use in modules section in plugin.json.