Coder Social home page Coder Social logo

Comments (5)

matt-aitken avatar matt-aitken commented on May 13, 2024

@cver that JSON url isn't publicly accessible, so it actually links to an HTML page with a login panel.

from jsonhero-web.

ericallam avatar ericallam commented on May 13, 2024

Still shouldn't crash JSON Hero, so re-opened so we can fix that

from jsonhero-web.

matt-aitken avatar matt-aitken commented on May 13, 2024

Yep that is true, rewritten the title

from jsonhero-web.

sascha10000 avatar sascha10000 commented on May 13, 2024

I found that the result after 'useFetcher' in PreviewUri.tsx on the route "/actions/getPreview/${encodedUri}" is not structured as expected. Therefore type-checking for 'string' and injecting the output is a solution, but in my opinion it is a risk. On the other hand locally running it tells me that cloudflare is having some issues regarding some key-value store. But as I had by now not found the time to dive extremly deep into the code I can only start guessing at that point.

return (
    <div>
      {previewFetcher.type === "done" ? (
        <>
          {typeof previewFetcher.data == "string" ? (
            <PreviewBox>
              <Body>
                <span
                  dangerouslySetInnerHTML={{ __html: previewFetcher.data }}
                ></span>
              </Body>
            </PreviewBox>
          ) : "error" in previewFetcher.data ? (
            <PreviewBox>
              <Body>{previewFetcher.data.error}</Body>
            </PreviewBox>
          ) : (
            <PreviewUriElement info={previewFetcher.data} />
          )}
        </>
      ) : (
        <PreviewBox>
          <Body>Loading…</Body>
        </PreviewBox>
      )}
    </div>
  );

As a short fix I would preferably just show 'No preview available (Please report at: https://github.com/jsonhero-io/jsonhero-web/issues)' or so as seemingly due to status code 500 it should be fixed server-sided.

from jsonhero-web.

ericallam avatar ericallam commented on May 13, 2024

Fixed by @sascha10000 in PR #70

from jsonhero-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.