Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plunk is not a constructor #2

Open
awdr74100 opened this issue Oct 23, 2023 · 3 comments
Open

Plunk is not a constructor #2

awdr74100 opened this issue Oct 23, 2023 · 3 comments

Comments

@awdr74100
Copy link

螢幕擷取畫面 2023-10-23 154902

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!

@awdr74100
Copy link
Author

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

@driaug
Copy link
Member

driaug commented Nov 20, 2023

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!

@jasongitmail
Copy link

This should probably be highlighted in the README. Spent time troubleshooting it too. Thanks for the fix @awdr74100 Works well with that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants