#any workarounds for __dirname is not defined in ES module scope after transpilation?

2 messages · Page 1 of 1 (latest)

rapid fog
#

I'm trying to make a module that reads Zookeeper variables at runtime and saves them into unstorage, but I'm having issues with the zookeeper package. It's still using only CommonJS, and if I transpile it I get __dirname is not defined in ES module scopeI don't think this is a Nuxt issue. I think I'm just missing something...

Does anyone have any workarounds for this?
I've attempted to globally mock __dirname but I wasn't able to get it to work.

Here's the repo if anyone wants to take a look
https://github.com/Twitch0125/nuxt-zookeeper-module

GitHub

Contribute to Twitch0125/nuxt-zookeeper-module development by creating an account on GitHub.

rapid fog
#

I think I found the problem actually. I was getting this error because I was importing zookeeper into the module code. When importing in the plugin I saw no issues