We have a Symfony project and we use webpack encore. In our backend we have a WYSIWYG editor (ckeditor). As filemanager we use this bundle: https://github.com/helios-ag/FMElfinderBundle (which uses https://github.com/Studio-42/elFinder)
What my goal is: whenever you upload a file, run a controller function to add an entry in the database.
I made a js file (which is added to webpack.config.js) with some code to try and get this to work. On top, I added:
require('/public/bundles/fmelfinder/js/elfinder.min');
This will throw the following errors:
ERROR Failed to compile with 8 errors 10:13:37
These dependencies were not found:
* child_process in ./node_modules/coffee-script/lib/coffee-script/register.js
* fs in ./node_modules/clone-stats/index.js, ./node_modules/coffee-script/lib/coffee-script/coffee-script.js and 4 others
* rar in ./vendor/studio-42/elfinder/js/elfinder.min.js
To install them, you can run: npm install --save child_process fs rar
I've tried running yarn add child_process fs rar but it'll still give the same kinds of errors. I also checked, rar isn't even something, the folder in node_modules is completely empty aside from an empty package.json.
What am I doing wrong, and how can I achieve what I want?