No internet connection
  1. Home
  2. Support

Nuxt integration

By paul mendrik @menders
    2019-12-10 09:10:55.105Z

    Hi,

    I'm trying to integrate Talkyard comments into a Nuxt app but get the following errors:

    [Error] SyntaxError: Unexpected token '<'
    (anonymous function) (comments-for-conatus-it.talkyard.net:4)

    [Error] Refused to load https://c1.ty-cdn.net/-/embedded-comments?embeddingUrl=http://localhost:3000/post/mozart-desire-and-joy because it does not appear in the frame-ancestors directive of the Content Security Policy.

    [Error] Refused to load https://c1.ty-cdn.net/-/embedded-editor?embeddingUrl=http://localhost:3000/post/mozart-desire-and-joy because it does not appear in the frame-ancestors directive of the Content Security Policy.

    Any ideas ?

    Thanks

    Paul

    • 3 replies
    1. How does your config look? I'm thinking a config variable is wrong:

      Should be like this I think:

      <script>talkyardServerUrl='https://comments-for-conatus-it.talkyard.net';</script>
      <script async defer src="https://c1.ty-cdn.net/-/talkyard-comments.min.js"></script>
      

      But looks to me as if in your case, talkyardServerUrl is set to https://c1.ty-cdn.net... ? (or it's missing?)
      However it should be: https://comments-for-conatus .....

      (Only the <script async defer ... should use the CDN.)

      1. In reply tomenders:

        B.t.w. if you get this working, maybe you'd like to post your Nuxt config? I looked a little bit into Nuxt but didn't get that far (had to switch to other job tasks)

        1. M
          In reply tomenders:
          paul mendrik @menders
            2019-12-11 15:49:18.555Z

            Hi KajMagnus !

            I managed to get it to work by inserting the code in my nuxt.config.js file under script as follows :
            { talkyardServerUrl: "https://comments-for-conatus-it.talkyard.net" }, async: true, defer: true }

            Now I will try and change the look a bit !

            Thanks for a great platform

            Best wishes

            Paul