trpc-playground icon indicating copy to clipboard operation
trpc-playground copied to clipboard

trpc-playground@next is blocked by browser

Open kaminskypavel opened this issue 2 years ago • 5 comments

using it with express@4.

getting errors in multiple browsers

Refused to load the script 'https://cdn.jsdelivr.net/npm/@trpc-playground/[email protected]/dist/assets/index.70ae6946.js' because it violates the following Content Security Policy directive: "script-src 'self'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

kaminskypavel avatar Dec 15 '22 20:12 kaminskypavel

Which browser? I can't reproduce this on Chrome on MacOS.

sachinraja avatar Dec 18 '22 22:12 sachinraja

Tried it on brave/firefox/edge

On win 11

kaminskypavel avatar Dec 19 '22 06:12 kaminskypavel

For me this is working on brave (windows 11). Maybe try installing trpc-playground@latest.

MatsDK avatar Dec 19 '22 13:12 MatsDK

I've had the same issue for around a year now, I have to disable cors using a plugin for Firefox.

It would seem that the CDN does not accept localhost as pre-flight.

I'm guessing the maintainer uses a specific port for TRPC playground?

A better alternative instead of using a risky CDN is to just host the files inside the npm package. Better version control then @sachinraja

Screenshot 2023-07-03 at 17 40 26

ollyde avatar Jul 03 '23 15:07 ollyde

For an alternative we are using https://github.com/iway1/trpc-panel which is npm hosted internally.

ollyde avatar Jul 04 '23 14:07 ollyde