vue-intellisense
vue-intellisense copied to clipboard
"Cannot find module 'fs/promises'"
The index.cjs.js file in dist folder uses require('fs/promises')
instead of require('fs').promises
causing "Error: Cannot find module 'fs/promises'".
@mkarras where does it throw that error. Can you provide reproduction steps?
@mesqueeb it is thrown on console when running vue-int --input /src/components --output vetur --recursive
or any other generating command.
Which node version do you use? For some 12.X version it won't work. Have a look here.
@mkarras I'm not sure how to change the way that the rollup bundles that file. I think the easiest way for me to solve this issue is to find the first nodeJS version that introduced that submodule and make that the minimum compatible nodeJS version.
Tomorrow i will update to the latest node 12 version. Hopefully this fix the problem. Or I need to monkey patch your module.
if it doesn't work let me know !
Used the latest note 12 version: 12.22.1 with no success. With node 16 it worked. Need to test if nothing break with this version. Which version do you use?
Edit: Also works with 14.16.1.
I will try to rewrite the import logic so rollup bundles differently.
I also get this error. Running the command
vue-int --input components --output vetur --recursive
with:
macOS: v11.2.3 Node: v10.23.1
Let me know how I can help :)
Mine is also broken.
internal/modules/cjs/loader.js:818
throw err;
^
Error: Cannot find module 'fs/promises'
(...)
code: 'MODULE_NOT_FOUND',
requireStack: [
'(...)/node_modules/@vue-intellisense/scripts/dist/index.cjs.js',
'(...)/node_modules/vue-intellisense/cli.js'
]
I got the same error and also had to upgrade node to make it work.
Failed with: node v12.22.6
Worked with: node v14.17.6
Pr welcome