Skip to content
New issue

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

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

Already on GitHub? # to your account

Incompatible SockJS! Main site uses: "1.4.0", the iframe: "1.3.0". #7782

Closed
cuellarj opened this issue Oct 4, 2019 · 9 comments · Fixed by #7988
Closed

Incompatible SockJS! Main site uses: "1.4.0", the iframe: "1.3.0". #7782

cuellarj opened this issue Oct 4, 2019 · 9 comments · Fixed by #7988
Milestone

Comments

@cuellarj
Copy link

cuellarj commented Oct 4, 2019

Hi there,

I just upgraded to react-scripts v3.2.0 and am now see the below error in the console in my dev server:
image

Seems the issue is coming from the sockjs-client package. Tracking it down in my package-lock, react-scripts requires webpack-dev-server which in turn requires sockjs-client v1.3.0.
react-scripts also requires react-dev-utils, which requires sockjs-client v1.4.0. I think that's where the mismatch is coming from.

Do you have any advice moving forward?

Thank you.

@EmEmGee
Copy link

EmEmGee commented Oct 7, 2019

what's your webserver?

I had this today as well and solved it by adding these 3 lines to my nginx.conf file:

  location / {
    proxy_pass http://client:3000;
    proxy_redirect    default;
    proxy_set_header  Host $host;
    proxy_set_header  X-Real-IP $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header  X-Forwarded-Host $server_name;

    # WebSocket support added
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
  }

@cuellarj
Copy link
Author

cuellarj commented Oct 7, 2019

Hey @EmEmGee,

For dev we are using the default webpack dev server with an nginx reverse proxy.
I am now realizing the error only occurs on our hosted dev server (which uses nginx) and not on my local dev server, so your response got me excited. Unfortunately adding the three lines to our nginx.conf file didn't resolve the issue though.

Thanks for your advice on this!

@classic-paul
Copy link

I'm also using nginx (to reverse proxy requests to an Apollo server) and am seeing the same issue in the development server only. I also tried using those three lines in the nginx conf to no avail.

@cuellarj
Copy link
Author

cuellarj commented Oct 9, 2019

Update: Had a miscommunication with my back-end dev and those three lines were added outside the location object. The below settings fixed the issue (apologies for poor formatting). Thanks @EmEmGee for your original suggestion!

location / {
proxy_pass our_server;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}

@cuellarj cuellarj closed this as completed Oct 9, 2019
@JLeggatt
Copy link

I'm having the same issue but we're not running on nginx.

Can react-scripts bring webpack-dev-server up to a version that depends on sockjs-client v 1.4.0?
As react-dev-utils is depending on sockjs-client v 1.4.0, which is causing this issue for us.

@spathon
Copy link

spathon commented Oct 14, 2019

We are having the same issue and are using nginx with same config already.
The only other thing using WS is Apollo subscriptions.

@cuellarj
Copy link
Author

I closed this because my issue was resolved via the nginx fix but can reopen if needed.

@stale
Copy link

stale bot commented Nov 13, 2019

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale
Copy link

stale bot commented Nov 18, 2019

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

@stale stale bot closed this as completed Nov 18, 2019
@ianschmitz ianschmitz reopened this Nov 19, 2019
@stale stale bot removed the stale label Nov 19, 2019
@ianschmitz ianschmitz added this to the 3.3 milestone Nov 19, 2019
@lock lock bot locked and limited conversation to collaborators Nov 29, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants