LavaMoat / docs

React Native docs
1 stars 3 forks source link

MMM + SES: reflect-metadata/Reflect.js Attempting to define property on object that is not extensible #26

Closed leotm closed 1 year ago

leotm commented 1 year ago
Screenshot 2023-09-05 at 13 12 21

V8: Cannot define property decorate, object is not extensible

where reflect-metadata is a production dependency of @consensys/on-ramp-sdk@1.22.0

metamask@7.4.0
├─┬ @consensys/on-ramp-sdk@1.22.0
│ └── reflect-metadata@0.1.13
├─┬ @cucumber/messages@22.0.0
│ └── reflect-metadata@0.1.13 deduped
├─┬ @wdio/cucumber-framework@7.31.1
│ ├─┬ @cucumber/cucumber@8.6.0
│ │ ├─┬ @cucumber/gherkin-streams@5.0.1
│ │ │ └─┬ @cucumber/messages@21.0.1
│ │ │   └── reflect-metadata@0.1.13 deduped
│ │ ├─┬ @cucumber/gherkin-utils@8.0.0
│ │ │ └─┬ @cucumber/messages@19.1.4
│ │ │   └── reflect-metadata@0.1.13 deduped
│ │ ├─┬ @cucumber/gherkin@24.0.0
│ │ │ └─┬ @cucumber/messages@19.1.4
│ │ │   └── reflect-metadata@0.1.13 deduped
│ │ └─┬ @cucumber/messages@19.1.2
│ │   └── reflect-metadata@0.1.13 deduped
│ ├─┬ @cucumber/gherkin@26.0.3
│ │ └─┬ @cucumber/messages@21.0.1
│ │   └── reflect-metadata@0.1.13 deduped
│ └─┬ @cucumber/messages@21.0.1
│   └── reflect-metadata@0.1.13 deduped
├─┬ prettier-plugin-gherkin@1.1.1
│ └─┬ @cucumber/messages@19.1.4
│   └── reflect-metadata@0.1.13 deduped
└─┬ wdio-cucumberjs-json-reporter@4.4.3
  └─┬ @cucumber/gherkin@22.0.0
    └─┬ @cucumber/messages@17.1.1
      └── reflect-metadata@0.1.13 deduped

required by our app/components/UI/Ramp/Views/Settings/Settings.tsx screen wrapped by HOC withFiatOnRampSDK

Reflect Reflect2

enter vetted shims for the solution

leotm commented 1 year ago

nb: https://github.com/MetaMask/metamask-mobile/pull/6586/commits/310defe8ddf4ee3fccefebc9edd3d0a5e447f085 gets us to this furthest point partial solution without vetted shims

TypeError: Reflect.getOwnMetadata is not a function. (In 'Reflect.getOwnMetadata('design:sdkparams', target, propertyKey)', 'Reflect.getOwnMetadata' is undefined)
Screenshot 2023-09-04 at 17 30 53

then (soon to be) ses@0.18.8 gives us the full solution allowing for reflect-metadata as a vetted shim rather than called prior lockdown baked into RN

leotm commented 1 year ago

fixed in https://github.com/MetaMask/metamask-mobile/pull/6586/commits/310defe8ddf4ee3fccefebc9edd3d0a5e447f085 and https://github.com/MetaMask/metamask-mobile/pull/6586/commits/9f2372b8e11845e353f15cb198627e07227d78d8