I am facing an issue while trying to add actions in my Adobe I/O project using the aio app add actions command. The error I get is:
Error: Named export 'loadFile' not found. The requested module 'mem-fs' is a CommonJS module, which may not support all module.exports as named exports.
>aio app add actions
When i try to add action, I see below error
i Installing template @adobe/generator-add-action-generices, go to https://adobe.ly/templates
i Installing npm package @adobe/generator-add-action-generic
changed 1 package, and audited 1258 packages in 17s
176 packages are looking for funding
run `npm fund` for details
22 vulnerabilities (5 low, 12 moderate, 5 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues possible (including breaking changes), run:
npm audit fix --force
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
√ Installed npm package @adobe/generator-add-action-generic
» Error: Named export 'loadFile' not found. The requested module 'mem-fs' is a CommonJS module, which may not support all module.exports as named exports.
» CommonJS modules can always be imported via the default export, for example using:
»
» import pkg from 'mem-fs';
» const { loadFile } = pkg;
Any guidance or workaround would be greatly appreciated. Thanks!
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Does the add action wizard load successfully for you? this is the wizard sequence for me
after selecting all action templates, I chose generator-add-action-generic similar to you.
and provided action name. I tried add action from node22 as well and works.
Can you try
and finally add action. Looks like some dependency is obsolete in your project that is conflicting when generic-action is installed. try clearing and reinstall, maybe node will resolve dependencies rightly.
Views
Replies
Total Likes
Thanks for the suggestions.
Yes the action wizard is loading for me and i have selected the same options you suggested. Still facing the same issue.
Issue Details:
Run `npm audit` for details.
√ Installed npm package @adobe/generator-add-action-generic
» Error: Named export 'loadFile' not found. The requested module 'mem-fs' is a CommonJS module, which may not support all
» module.exports as named exports.
» CommonJS modules can always be imported via the default export, for example using:
»
» import pkg from 'mem-fs';
» const { loadFile } = pkg;
»
Views
Replies
Total Likes
is this 'mem-fs' dependency, part of your code? is it in your package.json or just loaded by some dependency?
coz 2 months back same issue was reported and suggested to move the dependency to peer dependency.
https://github.com/yeoman/yo/issues/803#issuecomment-2552635393
worth a try if you are only adding mem-fs to your dependencies.
Views
Replies
Total Likes
I looks like mem-fs is loaded by @adobe/generator-app-events-generic dependency.
I've tried multiple ways to resolve it, but I'm not sure where exactly to modify mem-fs.
Views
Replies
Total Likes
1 more worthy attempt might be to demote Node to 20. Do cache clean
and retry
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies