Closed FengFuLiu closed 5 months ago
react-native can not use @perry-mitchell
import { AuthType, createClient } from 'webdav/dist/react-native'
const client = createClient('https://dav.jianguoyun.com/dav/', {
authType: AuthType.Password,
username: 'xxxx',
password: 'xxxxx',
})
will error with [Error: Exception in HostFunction: Compiling JS failed: 1238:15:unrecognized Unicode character \u2118 Buffer size 305861 starts with: 5f5f642866756e6374696f6e2028676c and has protection mode(s): rw-p]
use from webdav/dist/web
is work😂
It's actually import {} from "webdav/react-native", no need for the dist. And even just importing from
"webdav"should work as we have the
react-native` entry in the package.json. I'm using that here.
Can you try just importing webdav directly?
from "webdav" not work, throw this
and if from "webdav/react-native", it throw Unable to resolve "webdav/react-native"
BTW: use "react-native": "0.73.4", "webdav": "^5.5.0"
I have the same problem. Were you able to solve this?
All the issues I'm currently seeing here point to the fact that this library uses references on both sides (node/web) that simply won't work on RN. On the web side we have document references, and on the node side we have http agent references. Neither will ever work.
I'm trying to figure out how to bypass this issue now.
Please see updated docs: https://github.com/perry-mitchell/webdav-client?tab=readme-ov-file#react-native-support
show error when i import webdav/react-native