Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React-Native import fails #366

Closed
FengFuLiu opened this issue Feb 27, 2024 · 8 comments · Fixed by #372
Closed

React-Native import fails #366

FengFuLiu opened this issue Feb 27, 2024 · 8 comments · Fixed by #372

Comments

@FengFuLiu
Copy link

show error when i import webdav/react-native

@FengFuLiu
Copy link
Author

4ba2cb8df2eff760a90d1daac8cec9d2

@ihwf
Copy link

ihwf commented Feb 29, 2024

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]

image

@ihwf
Copy link

ihwf commented Feb 29, 2024

use from webdav/dist/web is work😂

@perry-mitchell
Copy link
Owner

perry-mitchell commented Mar 18, 2024

It's actually import {} from "webdav/react-native", no need for the dist. And even just importing from "webdav"should work as we have thereact-native` entry in the package.json. I'm using that here.

Can you try just importing webdav directly?

@ihwf
Copy link

ihwf commented Mar 19, 2024

from "webdav" not work, throw this
image
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"

@Lucas-vdr-Horst
Copy link

I have the same problem. Were you able to solve this?

@perry-mitchell perry-mitchell changed the title webdav/react-native not found React-Native import fails Apr 21, 2024
@perry-mitchell
Copy link
Owner

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.

@perry-mitchell
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants