agea/CmisJS

Error: TypeError: undefined is not an object (evaluating 'self.atob.bind')

Opened this issue · 0 comments

I want to download/upload Files along the CMIS specification with an existing Apache Chemistry Server on localhost.

Currently I am working on the mobile application with react native and expo that should be able to login to the CMIS Server at first.

When I install it (npm i cmis), and import it like that:

import {cmis} from 'cmis'

and want to use it like that as the documentation states:

import { cmis } from 'cmis';

export default function RepoManager({ navigation }) {

const [isLoggedIn, setIsLoggedIn] = useState(false);
const [modalVisible, setModalVisible] = useState(true);

useEffect(() => {
let session = new cmis.CmisSession('https://localhost/cmis/browser');
console.log(session);

}, [])
....
....
I get the following Error:

TypeError: undefined is not an object (evaluating 'self.atob.bind')
at node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:95:4 in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:141:19 in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleError
at node_modules\expo-error-recovery\build\ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:86:13 in tryCatch
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:66:31 in
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:86:13 in tryCatch
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:124:27 in invoke
at node_modules@babel\runtime\helpers\regeneratorRuntime.js:130:16 in PromiseImpl.resolve.then$argument_0
at node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOne
at node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:248:12 in _allocateCallback$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:112:14 in _callTimer
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:162:14 in _callReactNativeMicrotasksPass
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:413:41 in callReactNativeMicrotasks
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:391:6 in __callReactNativeMicrotasks
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:133:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:368:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:132:4 in flushedQueue
screenshot error cmis js

Also when I try it with vite react:

image

What am I doing wrong? Is the Package broken? does it even work with react native? Are there alternatives? (would be glad for every answer i could get)

Thank you!