question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Postmark v2.5.0 & v2.5.1 Has Cryptic XMLHttpRequest Issues

See original GitHub issue

When using postmark.TemplatedMessage and sendEmailBatchWithTemplates I get an odd error without a lot of description. Downgrading to 2.3.5 fixes this issue. The problem is present in both 2.5.0 & 2.5.1.

Message:

PostmarkError: The string did not match the expected pattern.
    at ErrorHandler.Object.<anonymous>.ErrorHandler.buildGeneralError (/Users/zjr/Developer/Current/csns/node_modules/postmark/src/client/ErrorHandler.ts:37:16)
    at ErrorHandler.Object.<anonymous>.ErrorHandler.buildRequestError (/Users/zjr/Developer/Current/csns/node_modules/postmark/src/client/ErrorHandler.ts:23:25)
    at /Users/zjr/Developer/Current/csns/node_modules/postmark/src/client/BaseClient.ts:116:41

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ibaloshcommented, May 25, 2021

Hi @hequ

thanks for details! I add them to the wiki.

1reaction
hequcommented, May 25, 2021

Just commenting here if anyone encounters this in the future. I got this same error when running tests with jest and using postmark client 2.7.4. Jest runs by default in jsdom mode so it has a window. When I changed jest to run in node, this error went away. Apparently, Axios is doing something funny in a browser context.

If you are interested, there are a couple of related errors which might help to understand the core reason:

https://github.com/facebook/jest/issues/5737 https://github.com/axios/axios/issues/1180

Read more comments on GitHub >

github_iconTop Results From Across the Web

Postmark v2.5.0 & v2.5.1 Has Cryptic XMLHttpRequest Issues #61
When using postmark.TemplatedMessage and sendEmailBatchWithTemplates I get an odd error without a lot of description. Downgrading to 2.3.5 fixes this issue.
Read more >
XMLHttpRequest - Web APIs | MDN
Chrome Edge XMLHttpRequest Full support. Chrome1. Toggle history Full support. Edge12... XMLHttpRequest() constructor Full support. Chrome1. Toggle history Full support. Edge12... abort Full support. Chrome1. Toggle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found