Open gowthambalashanmugam opened 2 years ago
I get the same error. I've attempted a few things: none of which have helped.
import {imread} from '@techstark/opencv-js';
) and even just including that single function causes the same problem.For added context, this error occurs after (or perhaps right at the end) of bundling.
react-native start react-native
(or npm start
) works without errors.
Then run-android
(or npm run android
) seems to work fine up until 100% when it launches the app on your phone/emulator. Once that happens, you see the error above in the console and in the error dialog within the app.
I couldn't resolve that, else we can integrate OpenCV 3.4.1 as a native plugin which causes more weightage of the app but no option.
error: RangeError: Maximum call stack size exceeded
I get this error too on react-native 0.71.8 and expo ~48.0.15.
Any solutions?
I have the same issue
RangeError: Maximum call stack size exceeded
Anyone solved after 2 years? Getting the same error using
expo@51.0.13
react-native@0.74.2
@techstark/opencv-js@4.9.0-release.3
If you will comment babel error code highlighting - you will see the original error about the missed fs
module.
Currently searching for the workaround:
// package.json
"browser": {
"fs": false,
"path": false,
"crypto": false
},
and
// babel.config.js
plugins: [
[
'module-resolver',
{
alias: {
fs: false,
path: false,
os: false,
},
},
],
],
do not work for me '((
Then tried:
// metro.config.js
const config = {
resolver: {
extraNodeModules: {
fs: require.resolve('./empty-module'),
path: require.resolve('./empty-module'),
os: require.resolve('./empty-module'),
},
},
};
with
// empty-module.js
module.exports = {};
-- this solves the modules issue, but the library uses document.createElement("canvas")
, document.getElementById(imageSource)}
..., which is not present in RN.
It looks like the single solution is to use native modules https://brainhub.eu/library/opencv-react-native-image-processing
Facing below error when i tried to implement it, Can anyone help us to sort it out?
error: RangeError: Maximum call stack size exceeded at RegExp.exec ()
at tokenize (/Users/comp/work/mobile-app/react-mob-app/node_modules/@babel/highlight/lib/index.js:67:38)
at tokenize.next ()
at highlightTokens (/Users/comp/work/mobile-app/react-mob-app/node_modules/@babel/highlight/lib/index.js:84:3)
at highlight (/Users/comp/work/mobile-app/react-mob-app/node_modules/@babel/highlight/lib/index.js:112:12)
at codeFrameColumns (/Users/comp/work/mobile-app/react-mob-app/node_modules/@babel/code-frame/lib/index.js:103:65)
at UnableToResolveError.buildCodeFrameMessage (/Users/comp/work/mobile-app/react-mob-app/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:264:12)
at new UnableToResolveError (/Users/comp/work/mobile-app/react-mob-app/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:223:35)
at ModuleResolver.resolveDependency (/Users/comp/work/mobile-app/react-mob-app/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:129:15)
at DependencyGraph.resolveDependency (/Users/comp/work/mobile-app/react-mob-app/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/node-haste/DependencyGraph.js:288:43)