Closed xementor closed 4 months ago
Hi @xementor
Adding .mjs
files support to the metro.config.js
fixed the issue for me - https://github.com/GeekyAnts/NativeBase/issues/4678#issuecomment-1066434275
My metro.config.js
content:
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require('expo/metro-config');
/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname, {
// [Web-only]: Enables CSS support in Metro.
isCSSEnabled: true,
});
config.resolver.sourceExts.push('mjs', 'cjs'); // fixes stable-hash module resolve issue
module.exports = config;
hm interesting, thanks for sharing @oleh-mryhlod. not sure why i didn't face this issue
I had a similar issue with
dripsy: 4.3.3,
expo: 49.0.7,
@oleh-mryhlod fix to the rescue
Hi @xementor Adding
.mjs
files support to themetro.config.js
fixed the issue for me - GeekyAnts/NativeBase#4678 (comment)My
metro.config.js
content:// Learn more https://docs.expo.io/guides/customizing-metro const { getDefaultConfig } = require('expo/metro-config'); /** @type {import('expo/metro-config').MetroConfig} */ const config = getDefaultConfig(__dirname, { // [Web-only]: Enables CSS support in Metro. isCSSEnabled: true, }); config.resolver.sourceExts.push('mjs', 'cjs'); // fixes stable-hash module resolve issue module.exports = config;
Same issue with
"dripsy": "^4.3.4",
"expo": "49.0.16",
This solution fixed it for me as well.
Static Rendering Error (Node.js) Metro has encountered an error: While trying to resolve module
stable-hash
from fileH:\code\react_native\expo-router-tst\node_modules\dripsy\build\core\use-sx.js
, the packageH:\code\react_native\expo-router-tst\node_modules\stable-hash\package.json
was successfully found. However, this package itself specifies amain
module field that could not be resolved (H:\code\react_native\expo-router-tst\node_modules\stable-hash\dist\index.mjs
. Indeed, none of these files exist: