trashhalo / obsidian-extract-url

Plugin to extract markdown out of urls
GNU General Public License v3.0
274 stars 12 forks source link

build: method not found in `Navigator` #33

Closed ZutJoe closed 10 months ago

ZutJoe commented 10 months ago

platform: window10 22H2 ide: vscode

Had an error when I cloned the project, installed all dependencies, and used wasm-pack build command to build the project

error[E0599]: no method named `clipboard` found for struct `Navigator` in the current scope
   --> src\extract.rs:141:14
    |
138 | /         window()
139 | |             .ok_or(ExtractError::NoClipboard)?
140 | |             .navigator()
141 | |             .clipboard()
    | |             -^^^^^^^^^ method not found in `Navigator`
    | |_____________|
    |

also, my vscode linter has the tip:

image

I tried to use https://github.com/rustwasm/wasm-bindgen/issues/2339#issuecomment-1441392656 , but it can't solve this problem

Could you give me some tips to solve the problem?

ZutJoe commented 10 months ago

I'm sorry to bother you, I think I found the solution on the https://github.com/rustwasm/wasm-bindgen/issues/2684#issuecomment-922247764 ,and the https://github.com/rustwasm/wasm-bindgen/issues/2339#issuecomment-1441392656 answer is also right

Thank you so much for providing such a nice plugin