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

Latest version does not work for browser #11

Closed
Kaassouffleetje opened this issue Oct 16, 2023 · 1 comment
Closed

Latest version does not work for browser #11

Kaassouffleetje opened this issue Oct 16, 2023 · 1 comment

Comments

@Kaassouffleetje
Copy link

The quickstart code from the readme gives errors when ran in a browser.
The code:

<script src="https://cdn.jsdelivr.net/gh/cemalgnlts/Mailjs@latest/mailjs.min.js"></script>

<!-- you can exlude this if not listening to events (may cause runtime error) -->
<script src="https://cdn.jsdelivr.net/gh/cemalgnlts/Mailjs@latest/eventsource.min.js"></script>

<script>
	const mailjs = new Mailjs();
</script>

The errors: Uncaught ReferenceError: EventSourcePolyfill is not defined on line 1 of mailjs.min.js and Uncaught TypeError: Mailjs is not a constructor on line 6 of the example code.

The example in the examples folder works fine. This is because that example uses version 2.0. Changing "latest" in the quickstart code to 2.0 makes it work. But then I'm unfortunately missing out from the new features in 2.2.

@cemalgnlts
Copy link
Owner

cemalgnlts commented Oct 17, 2023

Thanks,

I'll check the error.

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

2 participants