supershaneski/openai-whisper-talk

Error with __dirname

Closed this issue · 1 comments

Very interesting project! Would love to run it locally to give it a spin and check it out. But I have the following error. Tried with Node v18 and v20:


[6:51:58 AM]  ERROR  Importing directly from module entry-points is not allowed. [importing formidable from server/api/editprompt.js]

ℹ Vite server warmed up in 813ms                                                                    6:51:58 AM
✔ Nitro built in 603 ms                                                                       nitro 6:51:58 AM
[nuxt] [request error] [unhandled] [500] __dirname is not defined
  at <anonymous> (./node_modules/formidable/src/Formidable.js:94:34)  
  at Array.forEach (<anonymous>)  
  at IncomingForm (./node_modules/formidable/src/Formidable.js:91:33)  
  at formidable (./node_modules/formidable/src/index.js:13:33)  
  at <anonymous> (./server/api/transcribe.js:33:1)  
  at async Object.handler (./node_modules/h3/dist/index.mjs:1676:19)  
  at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:1886:7)

Any idea why this happens and how to fix it?

Thanks!

I had installed packages with a different node version.

Cleaning up my node_module folder and ensuring to use npm worked ✨