Repository navigation
Closed
Closed
Copy link
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionWeeklyKSv2KSv2
Description
Details
This PR:
introduced a regression, where when you said CAPTURE_METRICS=true in your env and try to run the app, you'll get the following error:
BUNDLE ./index.js
error: index.js: Duplicate plugin/preset detected.
If you'd like to use two separate instances of a plugin,
they need separate names, e.g.
plugins: [
['some-plugin', {}],
['some-plugin', {}, 'some unique name'],
]
Duplicates detected are:
[
{
"alias": "/Users/hannomargelo/Documents/Github/expensify-app-fork/node_modules/babel-plugin-module-resolver/lib/index.js",
"options": {
"extensions": [
".native.js",
".native.jsx",
".native.ts",
".native.tsx",
".js",
".jsx",
".ts",
".tsx",
".ios.js",
".ios.jsx",
".ios.ts",
".ios.tsx",
".android.js",
".android.jsx",
".android.ts",
".android.tx"
],
"alias": {
"@assets": "./assets",
"@components": "./src/components",
"@hooks": "./src/hooks",
"@libs": "./src/libs",
"@navigation": "./src/libs/Navigation",
"@pages": "./src/pages",
"@styles": "./src/styles",
"@src": "./src",
"@userActions": "./src/libs/actions"
}
},
"dirname": "/Users/hannomargelo/Documents/Github/expensify-app-fork",
"ownPass": false,
"file": {
"request": "module-resolver",
"resolved": "/Users/hannomargelo/Documents/Github/expensify-app-fork/node_modules/babel-plugin-module-resolver/lib/index.js"
}
},
{
"alias": "/Users/hannomargelo/Documents/Github/expensify-app-fork/node_modules/babel-plugin-module-resolver/lib/index.js",
"options": {
"root": [
"./"
],
"alias": {
"ReactNativeRenderer-prod": "/Users/hannomargelo/Documents/Github/expensify-app-fork/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling",
"scheduler/tracing": "scheduler/tracing-profiling"
}
},
"dirname": "/Users/hannomargelo/Documents/Github/expensify-app-fork",
"ownPass": false,
"file": {
"request": "module-resolver",
"resolved": "/Users/hannomargelo/Documents/Github/expensify-app-fork/node_modules/babel-plugin-module-resolver/lib/index.js"
}
}
]
Reason / solution
This is because if CAPTURE_METRICS in babel.config we push a second instance of the module-resolver plugin. Before the PR it was the only instance, and thus it was working:
Lines 88 to 93 in 2707647
| if (process.env.CAPTURE_METRICS === 'true') { | |
| const path = require('path'); | |
| const profilingRenderer = path.resolve(__dirname, './node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling'); | |
| metro.plugins.push([ | |
| 'module-resolver', |
Metadata
Metadata
Assignees
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionWeeklyKSv2KSv2
Activity
[-][Dev] App bundling fails with CAPTURE_METRICS=true[/-][+][HOLD for payment 2023-11-09] [Dev] App bundling fails with CAPTURE_METRICS=true[/+]melvin-bot commentedon Nov 2, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Nov 2, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.94-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-11-09. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.