Windy Community
    • Unread
    • Categories
    • Groups
    • Go to windy.com
    • Register
    • Login
    1. Home
    2. Madusara Liyanage
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 6
    • Groups 0

    Madusara Liyanage

    @Madusara Liyanage

    0
    Reputation
    1
    Profile views
    6
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    Madusara Liyanage Unfollow Follow

    Latest posts made by Madusara Liyanage

    • Is solar layer included in the API in premium?

      Is the solar layer included in the API in the premium version? It's not available in the free version.

      posted in Windy API v4
      Madusara LiyanageM
      Madusara Liyanage
    • RE: Has anybody used windy api with ReactJS or NextJs. Is it possible?

      @David-Ryzec-3

      Thank you so much for your response. I added a condition - if (typeof window !== 'undefined') inside the useEffect

      useEffect(() => {
          if (typeof window !== 'undefined'){
              // rest of the code
          }
      }, [])
      

      But still getting the same error.

      posted in Windy API v4
      Madusara LiyanageM
      Madusara Liyanage
    • RE: Has anybody used windy api with ReactJS or NextJs. Is it possible?

      @David-Ryzec-3

      Thank you so much for your response. I added a condition - if (typeof window !== 'undefined') inside the useEffect

      useEffect(() => {
          if (typeof window !== 'undefined'){
              // rest of the code
          }
      }, [])
      

      But still getting the same error.

      posted in Windy API v4
      Madusara LiyanageM
      Madusara Liyanage
    • RE: Has anybody used windy api with ReactJS or NextJs. Is it possible?

      @jorgef said in Has anybody used windy api with ReactJS or NextJs. Is it possible?:

      Hello, I don't use NextJS but this error looks like you're trying to access browser-only symbols on the server. You need to first check if the environment is browser.

      Thank you for your response.
      I added a window check condition inside the useEffect. But still the same behaviour is observed.

      useEffect(() => {
          if (typeof window !== 'undefined') {
            // rest of the code
          }
      }, [])
      

      When I do a change in the code (say add some styles to the div and save) the map is displayed properly for just one time. On subsequent page refreshes, the map is grey with the initial error message in the console. But in some random page refreshes, map is properly displayed.

      posted in Windy API v4
      Madusara LiyanageM
      Madusara Liyanage
    • RE: Has anybody used windy api with ReactJS or NextJs. Is it possible?

      @jorgef said in Has anybody used windy api with ReactJS or NextJs. Is it possible?:

      Hello, I don't use NextJS but this error looks like you're trying to access browser-only symbols on the server. You need to first check if the environment is browser.

      Thank you for your response.
      I added a window check condition inside the useEffect. But still the same behaviour is observed.

      useEffect(() => {
          if (typeof window !== 'undefined') {
            // rest of the code
          }
      }, [])
      

      When I do a change in the code (say add some styles to the div and save) the map is displayed properly for just one time. On subsequent page refreshes, the map is grey with the initial error message in the console. But in some random page refreshes, map is properly displayed.

      posted in Windy API v4
      Madusara LiyanageM
      Madusara Liyanage
    • Has anybody used windy api with ReactJS or NextJs. Is it possible?

      I created a nextjs component like this. Sometimes it works, but most of the time I see only a grey outlined map with no data and I get the error "ReferenceError: window is not defined" in the console.

      1c025395-9872-4ce9-8053-5648e1225fd4-image.png

      result

      2a2022fc-ea47-44ef-bb91-abad13347c05-image.png

      posted in Windy API v4
      Madusara LiyanageM
      Madusara Liyanage