Installing react on saleor using Launchdarkly throws error

141 Views Asked by At

I'm trying to install launch darkly on saleor storefront however it throws me an error

ERROR in ./node_modules/launchdarkly-js-client-sdk/dist/ldclient.es.js 1:18823
Module parse failed: Unexpected token (1:18823)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

my code is

const App = () => {
  return (
    <Layout>
      <Routes />
    </Layout>
  )
};

export default App;

const LDProvider = withLDProvider({
  clientSideID: 'xxxxxxxxxxxx',
  context: {
    "kind": "user",
    "key": "user-key-123abc",
    "name": "Sandy Smith",
    "email": "[email protected]"
  },
  options: { /* ... */ }
})(App);

<LDProvider>
   <App />
</LDProvider>

Is there anybody used it in saleor? I tried it on react admin and it works just fine.

0

There are 0 best solutions below