Fork me on GitHub
#cljsrn
<
2021-08-28
>
xavi11:08:05

Hello - Following Krell's Reagent Tutorial ( https://github.com/vouch-opensource/krell/wiki/Reagent-Tutorial ) I've been able to run the app successfully. Now I'm trying to use https://github.com/rnmods/react-native-document-picker I installed it with

yarn add react-native-document-picker

cd ios
pod install
and I'm trying to import it with
(def DocumentPicker (.-default (js/require "react-native-document-picker")))
but there's this error...
console.error: Could not evaluate  TypeError: undefined is not an object (evaluating 'require("react-native-document-picker").default')
I tried restarting the REPL, Metro and iOS Simulator. I've also upgraded to the latest Krell 0.5.1, but it didn't help. Any idea about why it doesn't work?

pvinis09:09:36

i did the same, and i did stop getting the initial error, but now I get another

pvinis09:09:05

of these files exist:
  * target/test.js(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
  * target/test.js/index(.native|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
  1 | module.exports = {
  2 |   krellNpmDeps: {
> 3 |     "./test.js": require('./test.js')  }
    |                           ^
  4 | };

pvinis09:09:22

im trying to js/require one of my files, test.js

pvinis09:09:39

do i need to do something to make it included in the target dir?