chinedufn/psd

Drag and drop example doesn't work on Safari

jakeleventhal opened this issue · 2 comments

When dragging in a PSD I get this error in the browser console:

[Error] panicked at 'already borrowed: BorrowMutError', /rustc/fd4b177aabb9749dfb562c48e47379cea81dc277/src/libcore/cell.rs:877:9

Stack:

@https://chinedufn.github.io/psd/drag-drop-demo/drag_drop_browser.js:544:28
<?>.wasm-function[166]@[wasm code]
<?>.wasm-function[642]@[wasm code]
<?>.wasm-function[307]@[wasm code]
<?>.wasm-function[442]@[wasm code]
<?>.wasm-function[480]@[wasm code]
<?>.wasm-function[359]@[wasm code]
<?>.wasm-function[172]@[wasm code]
<?>.wasm-function[510]@[wasm code]
__wbg_adapter_18@https://chinedufn.github.io/psd/drag-drop-demo/drag_drop_browser.js:197:134
real@https://chinedufn.github.io/psd/drag-drop-demo/drag_drop_browser.js:187:21


	(anonymous function) (drag_drop_browser.js:556)
	<?>.wasm-function[166]
	<?>.wasm-function[642]
	<?>.wasm-function[307]
	<?>.wasm-function[442]
	<?>.wasm-function[480]
	<?>.wasm-function[359]
	<?>.wasm-function[172]
	<?>.wasm-function[510]
	__wbg_adapter_18 (drag_drop_browser.js:197:135)
	real (drag_drop_browser.js:187)
[Error] RuntimeError: Unreachable code should not be executed (evaluating 'wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0464633ff841b041(arg0, arg1, addHeapObject(arg2))')
	<?>.wasm-function[307] (drag_drop_browser.js:197:135)
	<?>.wasm-function[442]
	<?>.wasm-function[480]
	<?>.wasm-function[359]
	<?>.wasm-function[172]
	<?>.wasm-function[510]
	__wbg_adapter_18 (drag_drop_browser.js:197:135)
	real (drag_drop_browser.js:187)

What happens if you use the psd crate to deserialize the bytes?

As in, what happens when you call this method on your PSD https://docs.rs/psd/0.3.5/psd/struct.Psd.html#method.from_bytes ?

This will help us rule out whether it's an issue with the demo or an issue with the parser.