lxieyang / chrome-extension-boilerplate-react

A Chrome Extensions boilerplate using React 18 and Webpack 5.
MIT License
3.42k stars 1.07k forks source link

[React Refresh] Failed to set up the socket connection. #156

Open sakibul-islam opened 1 year ago

sakibul-islam commented 1 year ago

When I first open the popup/options page, I get this error. But the auto-refresh works fine.

image

vu9huy commented 1 year ago

I got same problem

UchennaOkafor commented 1 year ago

How did you guys fix this problem?

osarhan commented 1 year ago

I got the same problem. havent solved it. If someone can respond with their solution, that would be great

udaya28 commented 1 year ago

I got the same problem.. any fixes?

UchennaOkafor commented 1 year ago

I just ended up using this template https://github.com/guocaoyi/create-chrome-ext

Specifically their vite react typescript template https://github.com/guocaoyi/create-chrome-ext/tree/main/template-react-ts

It's more lightweight, has less bugs, less bloat and works better. @udaya28 @osarhan

Hawstein commented 1 year ago

Encounter the same problem.

Just head to file webpack.config.js and replace the following line

isDevelopment && new ReactRefreshWebpackPlugin(),

to

isDevelopment && new ReactRefreshWebpackPlugin({ overlay: false }),

This will ignore the error overlay integration and fix the warning.

sakibul-islam commented 1 year ago

Thanks @Hawstein, it worked.

WynMars commented 1 year ago

use "npm run build" instead, anyway, I still encounter other problems and decide to go with other lightweight template

wilmoore commented 3 days ago

use "npm run build" instead, anyway, I still encounter other problems and decide to go with other lightweight template

@WynMars Curious which one you ended up going with?