YanYuanFE / react-native-signature-canvas

:black_nib: React Native Signature Component based WebView Canvas for Android && IOS && expo
MIT License
417 stars 149 forks source link

blocking issue on last 0.72.6 React Native CLI #344

Closed Productivix closed 7 months ago

Productivix commented 9 months ago

I installed on a RN 0.72.6 CLI the package as described - compilation is OK but the build phase gives a blocking issue (red):

Error: Unable to resolve module react-native-webview from /home/william/logiciels/logiciels-windows/dev_RN-Node-GIT/prodRnScCsv/node_modules/react-native-signature-canvas/index.js: react-native-webview could not be found within the project or in these directories:
  node_modules
  13 | import injectedApplication from "./h5/js/app";
  14 |
> 15 | import { WebView } from "react-native-webview";
     |                          ^
  16 |
  17 | const styles = StyleSheet.create({
  18 |   webBg: {
    at ModuleResolver.resolveDependency (/home/william/logiciels/logiciels-windows/dev_RN-Node-GIT/prodRnScCsv/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:139:15)
    at DependencyGraph.resolveDependency (/home/william/logiciels/logiciels-windows/dev_RN-Node-GIT/prodRnScCsv/node_modules/metro/src/node-haste/DependencyGraph.js:277:43)
    at Object.resolve (/home/william/logiciels/logiciels-windows/dev_RN-Node-GIT/prodRnScCsv/node_modules/metro/src/lib/transformHelpers.js:169:21)
    at Graph._resolveDependencies (/home/william/logiciels/logiciels-windows/dev_RN-Node-GIT/prodRnScCsv/node_modules/metro/src/DeltaBundler/Graph.js:473:35)
    at Graph._processModule (/home/william/logiciels/logiciels-windows/dev_RN-Node-GIT/prodRnScCsv/node_modules/metro/src/DeltaBundler/Graph.js:261:38)
    at async Graph._addDependency (/home/william/logiciels/logiciels-windows/dev_RN-Node-GIT/prodRnScCsv/node_modules/metro/src/DeltaBundler/Graph.js:372:20)
    at async Promise.all (index 14)
    at async Graph._processModule (/home/william/logiciels/logiciels-windows/dev_RN-Node-GIT/prodRnScCsv/node_modules/metro/src/DeltaBundler/Graph.js:322:5)
    at async Graph._addDependency (/home/william/logiciels/logiciels-windows/dev_RN-Node-GIT/prodRnScCsv/node_modules/metro/src/DeltaBundler/Graph.js:372:20)
    at async Promise.all (index 11)

It appears that Webview is not included in this package. But on contrary Webview is fr Expo projects not for CLI. So this package is reserved for Expo projects ? What solution for CLI projects ?

YanYuanFE commented 9 months ago

https://github.com/react-native-webview/react-native-webview/blob/master/docs/Getting-Started.md

try install

Productivix commented 8 months ago

hi, yes I tried : no effect on the problem, it is not installed inside the module

3r1kson commented 7 months ago

@Productivix you need to change the import on the index.js file from react-native-signature-canvas (node_modules/react-native-signature-canvas/index.js)

After installing webView, change the import from:

import { View, StyleSheet, WebView } from 'react-native';

to:

import { View, StyleSheet } from 'react-native';
import { WebView } from 'react-native-webview';

Check if this works for you. Best regards

Productivix commented 7 months ago

thank you for the info but I changed since my stock and implemented with success react-native-signature-capture