#Custom Module: EISDIR: illegal operation on a directory, read

3 messages · Page 1 of 1 (latest)

pastel latch
#

I have a custom module, when running nuxi prepare I am getting this error:
ERROR Error while requiring module ~/modules/my-module-name: Error: EISDIR: illegal operation on a directory, read

ERROR EISDIR: illegal operation on a directory, read

at Object.readSync (fs.js:592:3)
at tryReadSync (fs.js:366:20)
at readFileSync (fs.js:403:19)
at jiti (node_modules/jiti/dist/jiti.js:1:246780)
at requireModule (node_modules/@nuxt/kit/dist/index.mjs:284:26)
at normalizeModule (node_modules/@nuxt/kit/dist/index.mjs:432:55)
at installModule (node_modules/@nuxt/kit/dist/index.mjs:415:47)
at initNuxt (node_modules/nuxt/dist/index.mjs:1825:13)
at async loadNuxt (node_modules/nuxt/dist/index.mjs:1857:5)
at async loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:493:19)
at async Object.invoke (node_modules/nuxt/node_modules/nuxi/dist/chunks/prepare.mjs:30:18)
at async _main (node_modules/nuxt/node_modules/nuxi/dist/cli.mjs:50:20)

I get what the error means, it's trying to call readSync on a folder, but... Why is it? Am I missing some config?

#

I have it in nuxt.config.js modules object as: '~/modules/my-module-name',

hot frost
#

you need to point to the file which the export