Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why react app keep calling ws/info and ws/iframe.html ? #13524

Open
chiragjoshi28 opened this issue Feb 21, 2024 · 2 comments
Open

Why react app keep calling ws/info and ws/iframe.html ? #13524

chiragjoshi28 opened this issue Feb 21, 2024 · 2 comments

Comments

@chiragjoshi28
Copy link

chiragjoshi28 commented Feb 21, 2024

I have setup new project using create-react-app, and saw my scripts inside index.html are called multiple time

@kai-softr
Copy link

Do you have any chrome plugins that might be the culprit here?

@Rohitbadekar-639
Copy link

There are a couple of reasons why your React app might be calling ws/info and ws/iframe.html multiple times and causing your scripts in index.html to be loaded repeatedly. Here's how to diagnose and fix the issue:

  1. Webpack Code Splitting (Less Likely):

Create React App uses Webpack for bundling your code. In rare cases, Webpack's code splitting might be causing these additional calls.
This is less likely for a new project, but it's worth checking.
Solution:

Look for any code in your components that might be dynamically importing these resources using import() statements.
If you find dynamic imports, consider refactoring your code to load them only when needed.

  1. External Dependency Behavior (More Likely):

It's more probable that an external dependency you've installed is making these calls. Some libraries might use WebSockets or iframes for internal functionality and might be fetching information from these URLs.

Solution:

Review the documentation of any third-party libraries you've included in your project. Look for known behavior related to WebSockets or iframes.
If a specific library is causing the issue, you might be able to configure it to avoid these calls or consider using a different library.

  1. Debugging Network Calls:

Use your browser's developer tools to inspect network requests. This will help you identify which part of your code is making the calls.
Open the developer tools (usually F12 key).
Go to the "Network" tab.
Refresh your page and look for requests to ws/info and ws/iframe.html.
Expand the request to see which script or component is making the call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants