wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
24.13k stars 1.15k forks source link

RTCPeerConnection not found. ( ReferenceError ) #2787

Closed ElecTwix closed 1 year ago

ElecTwix commented 1 year ago

Description

I was working on webrtc client that needs some native browser functions and objects such as RTCPeerConnection{} to create one. I think it not implemented yet but I would like to see if it is the case if that please let me know what I'm doing wrong thanks for your project.

To Reproduce

  1. create wails project with a svelte kit
  2. create RTCPeerConnection{} on script tag on svelte
  3. run svelte wails dev

Expected behaviour

It need to create webrtc client such like native firefox etc.

Screenshots

I don't think it is need for this I had logs

Overriding existing handler for signal 10. Set JSC_SIGNAL_FOR_GC if you want WebKit to use a different signal
DEB | [DevWebServer] Serving DevServer at http://localhost:34115
DEB | [AssetHandler] Handling request '/' (file='.')
DEB | [AssetHandler] File '.' not found, serving '/' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/'
DEB | [AssetHandler] Handling request '/@vite/client' (file='@vite/client')
DEB | [AssetHandler] File '@vite/client' not found, serving '/@vite/client' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/@vite/client'
DEB | [AssetHandler] Handling request '/src/main.js' (file='src/main.js')
DEB | [AssetHandler] File 'src/main.js' not found, serving '/src/main.js' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/src/main.js'
DEB | [AssetHandler] Handling request '/src/App.svelte' (file='src/App.svelte')
DEB | [AssetHandler] File 'src/App.svelte' not found, serving '/src/App.svelte' by AssetHandler
DEB | [AssetHandler] Handling request '/src/style.css' (file='src/style.css')
DEB | [AssetHandler] File 'src/style.css' not found, serving '/src/style.css' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/src/App.svelte'
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/src/style.css'
DEB | [AssetHandler] Handling request '/node_modules/vite/dist/client/env.mjs' (file='node_modules/vite/dist/client/env.mjs')
DEB | [AssetHandler] File 'node_modules/vite/dist/client/env.mjs' not found, serving '/node_modules/vite/dist/client/env.mjs' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/node_modules/vite/dist/client/env.mjs'
4:59:14 PM [vite-plugin-svelte] /src/App.svelte:105:6 A11y: <video> elements must have a <track kind="captions">
4:59:14 PM [vite-plugin-svelte] /src/App.svelte:109:6 A11y: <video> elements must have a <track kind="captions">
DEB | [AssetHandler] Handling request '/node_modules/.vite/deps/svelte_internal.js' (file='node_modules/.vite/deps/svelte_internal.js')
DEB | [AssetHandler] File 'node_modules/.vite/deps/svelte_internal.js' not found, serving '/node_modules/.vite/deps/svelte_internal.js' by AssetHandler
DEB | [AssetHandler] Handling request '/src/assets/images/logo-universal.png' (file='src/assets/images/logo-universal.png')
DEB | [AssetHandler] Handling request '/wailsjs/go/main/App.js' (file='wailsjs/go/main/App.js')
DEB | [AssetHandler] File 'src/assets/images/logo-universal.png' not found, serving '/src/assets/images/logo-universal.png' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/src/assets/images/logo-universal.png?import'
DEB | [AssetHandler] File 'wailsjs/go/main/App.js' not found, serving '/wailsjs/go/main/App.js' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/wailsjs/go/main/App.js'
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/node_modules/.vite/deps/svelte_internal.js?v=9fc2457a'
DEB | [AssetHandler] Handling request '/node_modules/svelte-hmr/runtime/hot-api-esm.js' (file='node_modules/svelte-hmr/runtime/hot-api-esm.js')
DEB | [AssetHandler] File 'node_modules/svelte-hmr/runtime/hot-api-esm.js' not found, serving '/node_modules/svelte-hmr/runtime/hot-api-esm.js' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/node_modules/svelte-hmr/runtime/hot-api-esm.js?v=9fc2457a'
DEB | [AssetHandler] Handling request '/node_modules/svelte-hmr/runtime/proxy-adapter-dom.js' (file='node_modules/svelte-hmr/runtime/proxy-adapter-dom.js')
DEB | [AssetHandler] File 'node_modules/svelte-hmr/runtime/proxy-adapter-dom.js' not found, serving '/node_modules/svelte-hmr/runtime/proxy-adapter-dom.js' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/node_modules/svelte-hmr/runtime/proxy-adapter-dom.js?v=9fc2457a'
DEB | [AssetHandler] Handling request '/node_modules/.vite/deps/chunk-2SWUXKJS.js' (file='node_modules/.vite/deps/chunk-2SWUXKJS.js')
DEB | [AssetHandler] File 'node_modules/.vite/deps/chunk-2SWUXKJS.js' not found, serving '/node_modules/.vite/deps/chunk-2SWUXKJS.js' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/node_modules/.vite/deps/chunk-2SWUXKJS.js?v=9fc2457a'
DEB | [AssetHandler] Handling request '/node_modules/svelte-hmr/runtime/overlay.js' (file='node_modules/svelte-hmr/runtime/overlay.js')
DEB | [AssetHandler] File 'node_modules/svelte-hmr/runtime/overlay.js' not found, serving '/node_modules/svelte-hmr/runtime/overlay.js' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/node_modules/svelte-hmr/runtime/overlay.js?v=9fc2457a'
DEB | [AssetHandler] Handling request '/node_modules/svelte-hmr/runtime/index.js' (file='node_modules/svelte-hmr/runtime/in
dex.js')
DEB | [AssetHandler] File 'node_modules/svelte-hmr/runtime/index.js' not found, serving '/node_modules/svelte-hmr/runtime/index.js' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/node_modules/svelte-hmr/runtime/index.js?v=9fc2457a'
DEB | [AssetHandler] Handling request '/node_modules/svelte-hmr/runtime/hot-api.js' (file='node_modules/svelte-hmr/runtime/hot-api.js')
DEB | [AssetHandler] File 'node_modules/svelte-hmr/runtime/hot-api.js' not found, serving '/node_modules/svelte-hmr/runtime/hot-api.js' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/node_modules/svelte-hmr/runtime/hot-api.js?v=9fc2457a'
DEB | [AssetHandler] Handling request '/node_modules/svelte-hmr/runtime/proxy.js' (file='node_modules/svelte-hmr/runtime/proxy.js')
DEB | [AssetHandler] File 'node_modules/svelte-hmr/runtime/proxy.js' not found, serving '/node_modules/svelte-hmr/runtime/proxy.js' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/node_modules/svelte-hmr/runtime/proxy.js?v=9fc2457a'
DEB | [AssetHandler] Handling request '/node_modules/svelte-hmr/runtime/svelte-hooks.js' (file='node_modules/svelte-hmr/runtime/svelte-hooks.js')
DEB | [AssetHandler] File 'node_modules/svelte-hmr/runtime/svelte-hooks.js' not found, serving '/node_modules/svelte-hmr/runtime/svelte-hooks.js' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/node_modules/svelte-hmr/runtime/svelte-hooks.js?v=9fc2457a'
DEB | [AssetHandler] Handling request '/src/assets/fonts/nunito-v16-latin-regular.woff2' (file='src/assets/fonts/nunito-v16-latin-regular.woff2')
DEB | [AssetHandler] File 'src/assets/fonts/nunito-v16-latin-regular.woff2' not found, serving '/src/assets/fonts/nunito-v16-latin-regular.woff2' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/src/assets/fonts/nunito-v16-latin-regular.woff2'

To develop in the browser and call your bound Go methods from Javascript, navigate to: http://localhost:34115
DEB | [AssetHandler] Handling request '/' (file='.')
DEB | [AssetHandler] File '.' not found, serving '/' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/'
DEB | [AssetHandler] Handling request '/src/main.js' (file='src/main.js')
DEB | [AssetHandler] Handling request '/@vite/client' (file='@vite/client')
DEB | [AssetHandler] File 'src/main.js' not found, serving '/src/main.js' by AssetHandler
DEB | [AssetHandler] File '@vite/client' not found, serving '/@vite/client' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/src/main.js'
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/@vite/client'
DEB | [AssetHandler] Handling request '/src/style.css' (file='src/style.css')
DEB | [AssetHandler] File 'src/style.css' not found, serving '/src/style.css' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/src/style.css'
DEB | [AssetHandler] Handling request '/src/App.svelte' (file='src/App.svelte')
DEB | [AssetHandler] File 'src/App.svelte' not found, serving '/src/App.svelte' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/src/App.svelte'
DEB | [AssetHandler] Handling request '/node_modules/vite/dist/client/env.mjs' (file='node_modules/vite/dist/client/env.mjs')
DEB | [AssetHandler] File 'node_modules/vite/dist/client/env.mjs' not found, serving '/node_modules/vite/dist/client/env.mjs' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/node_modules/vite/dist/client/env.mjs'
DEB | [AssetHandler] Handling request '/node_modules/.vite/deps/chunk-2SWUXKJS.js.map' (file='node_modules/.vite/deps/chunk-2SWUXKJS.js.map')
DEB | [AssetHandler] File 'node_modules/.vite/deps/chunk-2SWUXKJS.js.map' not found, serving '/node_modules/.vite/deps/chunk-2SWUXKJS.js.map' by AssetHandler
DEB | [ExternalAssetHandler] Loading 'http://localhost:5173/node_modules/.vite/deps/chunk-2SWUXKJS.js.map'

Attempted Fixes

It is working on a browser with DevServer. I tried to debug but I couldn't go anywhere I think the browser native method does not exist here.

System Details

# System

OS           | Arch Linux
Version      | Unknown   
ID           | arch      
Go Version   | go1.20.6  
Platform     | linux     
Architecture | amd64     

# Wails

Version         | v2.5.1                                  
Revision        | ea6dcc2c9457057f1e418e27273177182c24727d
Modified        | true                                    
Package Manager | pacman                                  

# Dependencies

Dependency | Package Name | Status    | Version    
*docker    | docker       | Installed | 1:24.0.2-1 
gcc        | gcc          | Installed | 13.1.1-2   
libgtk-3   | gtk3         | Installed | 1:3.24.38-1
libwebkit  | webkit2gtk   | Installed | 2.40.3-1   
npm        | npm          | Installed | 9.8.0-3    
pkg-config | pkgconf      | Installed | 1.8.1-1    
* - Optional Dependency

# Diagnosis

Your system is ready for Wails development!

Additional context

I think it is clear enough that if it is requested I can give details too. Thanks.

leaanthony commented 1 year ago

Hi! It looks like you're asking about browser API support. Wails does not embed a browser, but a webview, so all the browser APIs may not be available. Here are some links that may help you find what you are looking for. Let us know how you get on!

Windows:

Mac:

Linux:

zhaojunliing commented 6 months ago

How was it resolved?