0

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": "sandy@example.com"
  },
  options: { /* ... */ }
})(App);

<LDProvider>
   <App />
</LDProvider>

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

denmg
  • 360
  • 3
  • 12
  • 1
    Based on the error, it looks like some kind of webpack configuration change is needed. I don't know enough about Saleor to answer the question, and it is tough to tell what file it is trying to load based upon the above since this is the minified JavaScript bundle, but I can say that I don't see any issues with your code. It's a build and deploy related problem that seems specific to Saleor. I'd reach out to their forums perhaps. – remotesynth Feb 10 '23 at 13:02
  • Hello, I was abled to work with saleor by installing lower version of it – denmg Feb 13 '23 at 10:12

0 Answers0