Describe the bug
When loading a svelte application with bind:clientHeight or bind:clientWidth on one of the elements on the page, window.chrome.webview.postMessage() is undefined due to delayed firing of DOMContentLoaded event
To Reproduce
Steps to reproduce the behavior:
- Clone this repo (or use
bind:clientWidth on any component)
yarn tauri dev && yarn dev
- Open Browser DevTools
- See error
Expected behavior
No Error
Platform and Versions:
Operating System - Windows, version 10.0.22458 X64
Webview2 - 94.0.992.31
Node.js environment
Node.js - 16.10.0
@tauri-apps/cli - 1.0.0-beta.10
@tauri-apps/api - 1.0.0-beta.8
Global packages
npm - 7.22.0
yarn - 1.22.11
Rust environment
rustc - 1.57.0-nightly
cargo - 1.57.0-nightly
App directory structure
/.git
/.vscode
/node_modules
/src
/src-tauri
/wwwroot
App
tauri.rs - 1.0.0-beta.8
build-type - bundle
CSP - default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe eval' 'unsafe-inline' 'self' img-src: 'self'
distDir - ../wwwroot
devPath - http://localhost:5000
framework - Svelte
bundler - Rollup
Additional Information:
Discord support conversion
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'postMessage')
at Object.invoke (<anonymous>:2:62)
at Rpc.notify (<anonymous>:41:41)
at <anonymous>:121:20
at new Promise (<anonymous>)
at invoke (<anonymous>:102:12)
at <anonymous>:396:18
at append (index.mjs:309)
at add_resize_listener (index.mjs:712)
at Object.m (App.svelte:5)
at mount_component (index.mjs:1727)
Describe the bug
When loading a svelte application with
bind:clientHeightorbind:clientWidthon one of the elements on the page,window.chrome.webview.postMessage()is undefined due to delayed firing ofDOMContentLoadedeventTo Reproduce
Steps to reproduce the behavior:
bind:clientWidthon any component)yarn tauri dev && yarn devExpected behavior
No Error
Platform and Versions:
Additional Information:
Discord support conversion