DEV Community

Cover image for Indunil Karima ponnaya
indunil
indunil

Posted on

Indunil Karima ponnaya

Let me check what's happening in the browser console. I suspect there might be a CORS (Cross-Origin Resource Sharing) issue when trying to fetch from Dev.to API from localhost. Let me open the browser to see the actual error. Now let me check the current BlogPage.jsx file to see if there are any issues: The code looks correct. The most likely issue is CORS (Cross-Origin Resource Sharing). Dev.to's API might be blocking requests from localhost. Let me create a simple test to verify if the API is accessible and also add a CORS proxy as a fallback.



Made changes.


Enter fullscreen mode Exit fullscreen mode

I also need to update the manual refresh function to use the same logic:



Made changes.


Enter fullscreen mode Exit fullscreen mode

Let me remove the duplicate fetchArticles function that's not being used:



Made changes.


Enter fullscreen mode Exit fullscreen mode

Summarized conversation historyI understand the issue - the site is still not updating with new articles. Let me investigate the current state and identify why the articles aren't updating properly. Now let me check the current state of the running site to see what's happening: Let me check if there's a dev server running and what the latest state looks like: Let me wait for the server to start and check the new port: Great! The server is running on port 3001. Now let me check the blog page: Now let me check if there are any real articles from Dev.to by testing the API directly: Perfect! I can see that the Dev.to API is returning real articles. There are 2 articles by the user "indunil":

  1. "indunil ponnaya" (published Jul 10, 2025)
  2. "bla bla bla" (published Jul 7, 2025)

The issue is that the site is showing demo articles instead of the real ones. Let me check the browser console to see what's happening: I can see the issue! The site is likely hitting CORS errors and falling back to demo data. Let me modify the BlogPage to improve the CORS handling and ensure it properly loads the real articles. The current logic seems to have an issue with the CORS proxy fallback.



Made changes.


Enter fullscreen mode Exit fullscreen mode

Top comments (0)