Coder Social home page Coder Social logo

Comments (4)

winhtaikaung avatar winhtaikaung commented on June 5, 2024

Hi @Dissarion Sorry for late reply , I tried to replicate your issue as follow

import React from "react";
import ReactDOM from "react-dom";
import ReactTinyLink from "react-tiny-link";
import "./styles.css";

function App() {
  const arr=["https://www.amazon.com/Steve-Madden-Mens-Jagwar-10-5/dp/B016X44MKA/ref=lp_18637582011_1_1?srs=18637582011&ie=UTF8&qid=1550721409&sr=8-1","https://www.amazon.com/Steve-Madden-Mens-Jagwar-10-5/dp/B016X44MKA/ref=lp_18637582011_1_1?srs=18637582011&ie=UTF8&qid=1550721409&sr=8-1","https://www.amazon.com/Steve-Madden-Mens-Jagwar-10-5/dp/B016X44MKA/ref=lp_18637582011_1_1?srs=18637582011&ie=UTF8&qid=1550721409&sr=8-1","https://www.amazon.com/Steve-Madden-Mens-Jagwar-10-5/dp/B016X44MKA/ref=lp_18637582011_1_1?srs=18637582011&ie=UTF8&qid=1550721409&sr=8-1","https://www.amazon.com/Steve-Madden-Mens-Jagwar-10-5/dp/B016X44MKA/ref=lp_18637582011_1_1?srs=18637582011&ie=UTF8&qid=1550721409&sr=8-1","https://www.amazon.com/Steve-Madden-Mens-Jagwar-10-5/dp/B016X44MKA/ref=lp_18637582011_1_1?srs=18637582011&ie=UTF8&qid=1550721409&sr=8-1","https://www.amazon.com/Steve-Madden-Mens-Jagwar-10-5/dp/B016X44MKA/ref=lp_18637582011_1_1?srs=18637582011&ie=UTF8&qid=1550721409&sr=8-1","https://www.amazon.com/Steve-Madden-Mens-Jagwar-10-5/dp/B016X44MKA/ref=lp_18637582011_1_1?srs=18637582011&ie=UTF8&qid=1550721409&sr=8-1"]
  return (
    <div className="App">
      <h1>React Tiny Link Example</h1>
      <h3>No Graphics</h3>
     {arr.map((item,k)=> <ReactTinyLink
        cardSize="small"
        key={k}
        showGraphic={false}
        maxLine={2}
        minLine={1}
        url={item}
     />)}
      
    </div>
  );
}

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

and it didn't break. So possible issues might probably that we are not passing the correct string to component or the string format of URL is not correct.

from react-tiny-link.

Dissarion avatar Dissarion commented on June 5, 2024

Previously, everything worked, but eventually stopped. Maybe, but I'm not sure, due to the fact that our project has added web sockets.

from react-tiny-link.

winhtaikaung avatar winhtaikaung commented on June 5, 2024

Can you try to change the proxyURL to your own proxyUrl?
you may want to clone

https://github.com/Rob--W/cors-anywhere

and host it on your own and pass the hosted proxyURL and try it again ?

from react-tiny-link.

balakedev avatar balakedev commented on June 5, 2024

Hi there, the similar problem here:

`renderLinkPreview = text => {
var matches = text.match(/(((https?://)|(www.))[^\s]+)/g);

if (matches) {
  var thisLink = matches[0];
  console.log("STRINGED: ", thisLink);
  return (
    <ReactTinyLink
      cardSize="small"
      showGraphic={true}
      maxLine={2}
      minLine={1}
      url={`${thisLink}`}
    />
  );
} else return false;

};
`
ERROR:
TypeError: Failed to construct 'URL': Invalid URL
when the url being checked is www.worldofwarcraft.com

from react-tiny-link.

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.