userPackagerOpts.sourceExts is not iterable (Expo cli 3.21.3)

It appeared again in 3.21.3

I have

"expo" : {
        "packagerOpts": {
            "config": "metro.config.js"
        }
}

metro.config.js

const blacklist = require('metro-config/src/defaults/blacklist');
module.exports = {
    resolver: {
        blacklistRE: blacklist([/.tmp\/.*/])
    }
};

Packager started after explicitely adding “sourceExts” to app.json

"expo" : {
        "packagerOpts": {
            "config": "metro.config.js",
            "sourceExts": ["js"]
        }
}
5 Likes

Yes I having the same problem. Request the Expo Team to fix this asap

3 Likes

same problem:

userPackagerOpts.sourceExts is not iterable
TypeError: userPackagerOpts.sourceExts is not iterable
at startReactNativeServerAsync (/@expo/xdl@57.9.12/src/Project.ts:1788:80)
at Object.startAsync (/@expo/xdl@57.9.12/src/Project.ts:2407:5)
at action (/Users/sbecker/.npm-global/lib/node_modules/expo-cli/src/commands/start.ts:181:3)
at /Users/sbecker/.npm-global/lib/node_modules/expo-cli/src/commands/start.ts:354:16
at Command. (/Users/sbecker/.npm-global/lib/node_modules/expo-cli/src/exp.ts:80:7)

1 Like

Add the code below in the app.json. Don’t forget to merge the contents if there is another “packagerOpts” before. :point_down:

“packagerOpts”: { “config”: “metro.config.js”, “sourceExts”: [“js”, “jsx”, “svg”, “svgx”] }

this works for me.

2 Likes

I downgraded to expo-cli@3.21.1 and it worked.

2 Likes

I got the same error on 3.21.3. Downgrading to 3.21.1 worked for me too.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.