Closed SmartByt3r closed 4 weeks ago
Can you change this code to the following?
{
test: /\.[cm]?[jt]sx?$/,
include: [
/node_modules(.*[/\\])+react-native/,
/node_modules(.*[/\\])+@react-native/,
/node_modules(.*[/\\])+@react-navigation/,
/node_modules(.*[/\\])+@react-native-community/,
/node_modules(.*[/\\])+expo/,
/node_modules(.*[/\\])+pretty-format/,
/node_modules(.*[/\\])+metro/,
/node_modules(.*[/\\])+abort-controller/,
/node_modules(.*[/\\])+@callstack[/\\]repack/,
],
use: 'babel-loader',
},
{
test: /\.[cm]?[jt]sx?$/,
include: [
/node_modules/
],
use: 'babel-loader',
}
Hi @SmartByt3r,
the solution @jhso-dev is correct, but to limit the impact and possibly other issues, you can change the node_modules
loading rule above to account for the otpauth
and @noble/hashes
(since it's a dependency of otpauth
):
diff --git a/templates/webpack.config.mjs b/templates/webpack.config.mjs
index 4f19a6f..e5a1f25 100644
--- a/templates/webpack.config.mjs
+++ b/templates/webpack.config.mjs
@@ -161,6 +161,8 @@ export default (env) => {
/node_modules(.*[/\\])+metro/,
/node_modules(.*[/\\])+abort-controller/,
/node_modules(.*[/\\])+@callstack[/\\]repack/,
+ /node_modules(.*[/\\])+otpauth/,
+ /node_modules(.*[/\\])+@nobles[/\\]hashes/,
],
use: 'babel-loader',
},
Let me know if that fixes the issue!
This issue has been marked as stale because it has been inactive for 30 days. Please update this issue or it will be automatically closed in 14 days.
Closing since answer was provided and there was no answer for a rather long time.
If the issue is still unsolved please create a new issue, thanks!
Environment
Description
I encountered an issue trying to use otpauth library with repack Currently I am trying to migrate a codebase from metro an encountered this issue, maybe am I missing some additional configuration?
Reproducible Demo
Screenshots:
webpack.config.mjs:
App.tsx