Closed jubi-git closed 3 months ago
Hey 👋, Could you provide the ghosler version?
As per the error, it looks there's an invalid url in the content. Is it possible that your post content has a malformed url?
I am using 0.96 using the docker image
Since I am in a testing environment, I triggered the newsletter using sequential unpublish -> publish
Just noticed I had 2 webhooks active. I think because I manually edited the webhook to add the 2369 port; since this is different from the Ghosler config GUI setting, I think an other webhook was added.
Yes, for every instance that you have and save the settings, a new webhook will be created if one doesn't exist with a similar url. But that shouldn't trigger an error like this from the new URL(elementUrl).host
call. The error states that the function call is not able to get the host of a url.
Could you share the post content or maybe check for these tags - a
, img
, iframe
and their respective set urls?
I created several posts sequentially and don't remember which one triggered this error. (There is no error or log file other than the console right?) Perhaps it was a post where I did not specify an header image. However I cannot replicate this issue with the post I created thusfar.
I see. Although this isn't a big issue but I think it should be a good idea to log this under errors and provide the wrong URL
instead of crashing the app.
I'll create a patch and instead log an error on console.
This is patched now in 0.97
.
Updates on ghosler-cli
& docker
registry will be available soon.
[2024-04-04 11:18:32 UTC] => [ERROR] => Newsletter: TypeError [ERR_INVALID_URL]: Invalid URL at new NodeError (node:internal/errors:405:5) at new URL (node:internal/url:676:13) at Element.<anonymous> (file:///usr/src/app/utils/newsletter.js:238:29) at LoadedCheerio.each (file:///usr/src/app/node_modules/cheerio/lib/esm/api/traversing.js:461:26) at #injectUrlTracking (file:///usr/src/app/utils/newsletter.js:229:45) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Newsletter.renderTemplate (file:///usr/src/app/utils/newsletter.js:148:19) at async Newsletter.send (file:///usr/src/app/utils/newsletter.js:33:60)
Originally posted by @jubi-git in https://github.com/ItzNotABug/ghosler/issues/36#issuecomment-2036908324