braze-inc / braze-web-sdk

Public repo for the Braze Web SDK
https://www.braze.com
Other
70 stars 25 forks source link

[Bug]: Cannot initialize Braze #145

Closed alexgolafv closed 9 months ago

alexgolafv commented 9 months ago

Braze Web SDK Version

4.9.0

Integration Method

NPM

Browser

Chrome

Steps To Reproduce


 import('./braze-exports').then((braze) => {
    braze.initialize(config.brazeApiKey, {
      baseUrl: config.brazeSdkEndpoint,
      enableLogging: process.env.NODE_ENV !== 'production',
    });
  });

Expected Behavior

I expect Braze to initialize

Actual Incorrect Behavior

Actually the internal lib is throwing an error with message i is not defined

Verbose Logs

logger.js:22 Braze: Initialization Options: {
  "baseUrl": "sdk.fra-02.braze.eu",
  "enableLogging": true
}
braze-instance.js:120 Uncaught (in promise) ReferenceError: i is not defined
    at Wt.initialize (braze-instance.js:120:1)
    at Object.initialize (initialize.js:3:1)
    at initializeBraze (index.js:34:1)
    at GlobalBrazeComponent._callee$ (index.js:15:1)
    at tryCatch (runtime.js:62:1)
    at Generator.invoke [as _invoke] (runtime.js:296:1)
    at prototype.<computed> [as next] (runtime.js:114:1)
    at step (index.js:36:1)
    at _next (index.js:36:1)

Additional Information

No response

davidbielik commented 9 months ago

Hi @alexgolafv let us know if there's anything we can help better document or anything still not working.

alexgolafv commented 8 months ago

Good morning 😊 the problem was related to my nextjs.. it is version 6… very old and obsolete already! Just added CDN in that case… on new next it is works as a charm!