guocaoyi / create-chrome-ext

🍺 Scaffolding your Chrome extension! Boilerplates: react \ vue \ svelte \ solid \ preact \ alpine \ lit \ stencil \ inferno \ vanilla
MIT License
1.42k stars 106 forks source link

Failed to construct 'WebSocket': The URL 'ws://localhost:undefined/' is invalid. #74

Open zanekwok opened 4 months ago

zanekwok commented 4 months ago

Uncaught (in promise) SyntaxError: Failed to construct 'WebSocket': The URL 'ws://localhost:undefined/' is invalid.

heo001997 commented 4 months ago

@zanekwok bro, add this config in vite.config.js

    server: {
      port: 5173,
      strictPort: true,
      hmr: {
        port: 5173,
      },
    },
RomkaLTU commented 3 weeks ago

@zanekwok bro, add this config in vite.config.js

    server: {
      port: 5173,
      strictPort: true,
      hmr: {
        port: 5173,
      },
    },

This will crash browser on every background/index.js edit. Didn't find any better option though.