Invalid URL for markdown-it-bundle


After doing an update today and enabling the S3_CDN_URL Option in the envs, everything but markdown-it-bundle loads.

While the assets on the server exist and have been uploaded, discourse still prefixes with the base url.
All other assets work just fine.

I have checked the uploads table, and all urls have the proper format.

Is there any other table I can look into or just a plain fix for this issue?

Is there any DbHelper like remap but for searching a string in the whole database?

1 Like

Did you follow a guide for setting up Discourse with S3? It seems like there is a lot of sophisticated straps you have to follow in order to set it up, according to this topic:

1 Like

I’m afraid this isn’t my forte, but I found this topic with a similar issue, if that might be of some help?


@crcoli7307 Yes that was exactly the topic I followed through :slight_smile:


Thank you for the topic!

So I changed the S3_CDN_URL to:


But sadly this broke everything, in terms of where the stylesheet loads from.

Could this be the bucket name as its almost equal to the domain?

Bucket name: tosdr-community

See how the stylesheets are constructed.

Just migrated to a new bucket: Its not the name of the bucket, same issue happening

UPDATE: I just checked the way markdown-it-bundle is embedded and executed the script_asset_path through the rail console (with slight modifications due to the missing request.env variable!)

According to the script_asset_path, the asset url is correctly generated. Still not sure why this is happening.


It seems to be a known bug


I “fixed” it by using the most dirtiest workaround available. Hardcoding the Asset in the nginx config and redirecting it

location ~ markdown-it-bundle-dcd9743077867b3a68d7b723130cb2711dc4c843b018d7bc609f868289402fef.(.*).js {
return 302$1.js;

Did the trick, unless the asset is updated :slight_smile:

1 Like