The js-ipfs code example below shows how to generate some random test content and publush it to IPFS, and then also use name.publish to publish the IPFS CID to IPNS:
It seems working fine for publishing and retrieving the content by any IPFS gateway, the published IPFS content is available. Running the code will give IPFS and IPNS links to access the content, example:
IPFS Content: …/ipfs/QmUYa5LpsEJgRCRStbfRaW46G48asWsbMeXPeF57ZNqnSA
IPNS Content: …/ipns/QmUwWUpyJtzoGx1qa3uiDP3JW57HCRVgRgbBzPMUqzM37
however the IPNS URL is never working. When trying to resolve the IPNS CID QmUwWUpyJtzoGx1qa3uiDP3JW57HCRVgRgbBzPMUqzM37 locally in the same browser window, it does resolve to the IPFS CID QmUYa5LpsEJgRCRStbfRaW46G48asWsbMeXPeF57ZNqnSA, but it seems like there is an issue with IPNS URLs getting published properly using this code. Feeling a bit stuck, any help is welcome.