Using Launch darkly 3.0.1 i am getting error while initializing the app

1.6k Views Asked by At

I am trying migrate to launchdarkly-react-client-sdk 3.0.1 from 2.28.2. I installed the latest package. But when i am starting the application i am getting error and application is unable to start. Error:- ./node_modules/launchdarkly-js-client-sdk/dist/ldclient.es.js 624:11 Module parse failed: Unexpected token (624:11) File was processed with these loaders:

  • ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js You may need an additional loader to handle the result of these loaders. | le = /^(\w|.|-)+$/; | function de(e) {

return e?.replace(//+$/, ""); | } | function fe(e, t, n) {

I am trying to migrate to launchdarkly-react-client-sdk 3.0.1 from 2.28.2. I installed the latest package. But when i am starting the application i am getting error and application is unable to start. Error:- ./node_modules/launchdarkly-js-client-sdk/dist/ldclient.es.js 624:11 Module parse failed: Unexpected token (624:11) File was processed with these loaders:

  • ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js You may need an additional loader to handle the result of these loaders. | le = /^(\w|.|-)+$/; | function de(e) {

return e?.replace(//+$/, ""); | } | function fe(e, t, n) {

2

There are 2 best solutions below

0
On

I have received exactly the same error as you when trying to do the same thing. I'm going to write Launch Darkly Support to see if they can unravel this mystery.

0
On

Are you using webpack 4? The migration guide specifies some of the breaking changes you may need to handle when updating:

https://docs.launchdarkly.com/sdk/client-side/react/web-migration-2-to-3

https://docs.launchdarkly.com/sdk/client-side/javascript/migration-2-to-3