Open awdr74100 opened 1 year ago
Hi, I think the problem comes from the fact that the module is based on CommonJS instead of ESM, so Nuxt (Nitro) and other projects with the "type": "module"
attribute cannot be loaded smoothly.
A simple fix is:
import Plunk from "@plunk/node";
const key = "..."
const plunk = new Plunk.default(key); // but typescript will prompt an error
Hey there! Sorry for missing this issue!
We are in the process of rewriting some of our open-source components so this issue will be resolved quite soon!
This should probably be highlighted in the README. Spent time troubleshooting it too. Thanks for the fix @awdr74100 Works well with that
repo: https://github.com/awdr74100/plunk-demo
I found that someone also raised this issue on discord, and they all happened to use Nuxt (Nitro) to build the backend. I can't confirm which side the problem is.
It would be great if this could be fixed! Any help is greatly appreciated!