amazon-connect / amazon-connect-chat-interface

Amazon Connect Chat Interface - a browser-based customer chat widget for your website integrating with Amazon Connect ChatJS
https://docs.aws.amazon.com/connect/latest/adminguide/what-is-amazon-connect.html
MIT No Attribution
36 stars 39 forks source link

[React Intl] Could not find required `intl` object (dev-build only) #16

Closed cmrockwell closed 3 years ago

cmrockwell commented 3 years ago

Hi I'm getting the error below when I build and test locally.

Here are the steps I take

  1. I want the locally built version of amazon-connect-chat-interface.js used in the local-testing $ cd local-testing $ mv amazon-connect-chat-interface.js amazon-connect-chat-interface-original.js $ ln -s ../build/dist/static/js/amazon-connect-chat-interface.js .

  2. Start the http-server

  3. Edit the local-testing/index.html with my instance ID, contact flow and region

  4. go up to the project root and run $ npm install && npm run dev-build

  5. Open the browser to http://127.0.0.1:8080/

This is what I see

Screen Shot 2021-05-05 at 6 04 51 PM

amazon-connect-chat-interface.js:81389 [React Intl] Could not find required intl object. needs to exist in the component ancestry. Using default message as fallback. at FormattedMessage (http://127.0.0.1:8080/amazon-connect-chat-interface.js:83700:5) at button at StyledComponent (http://127.0.0.1:8080/amazon-connect-chat-interface.js:105554:5) at styled.button at Button (http://127.0.0.1:8080/amazon-connect-chat-interface.js:114690:210) at StyledComponent (http://127.0.0.1:8080/amazon-connect-chat-interface.js:105554:5) at Styled(Button) at div at StyledComponent (http://127.0.0.1:8080/amazon-connect-chat-interface.js:105554:5) at styled.div at div at StyledComponent (http://127.0.0.1:8080/amazon-connect-chat-interface.js:105554:5) at styled.div at div at StyledComponent (http://127.0.0.1:8080/amazon-connect-chat-interface.js:105554:5) at styled.div at ChatActionBar (http://127.0.0.1:8080/amazon-connect-chat-interface.js:110423:210) at div at StyledComponent (http://127.0.0.1:8080/amazon-connect-chat-interface.js:105554:5) at styled.div at Chat (http://127.0.0.1:8080/amazon-connect-chat-interface.js:110175:210) at ChatContainer (http://127.0.0.1:8080/amazon-connect-chat-interface.js:111017:210) at div at StyledComponent (http://127.0.0.1:8080/amazon-connect-chat-interface.js:105554:5) at styled.div at ThemeProvider (http://127.0.0.1:8080/amazon-connect-chat-interface.js:105334:5) at ThemeProvider (http://127.0.0.1:8080/amazon-connect-chat-interface.js:115660:210) at AppProvider (http://127.0.0.1:8080/amazon-connect-chat-interface.js:109991:97) at App (http://127.0.0.1:8080/amazon-connect-chat-interface.js:110006:27) at Router (http://127.0.0.1:8080/amazon-connect-chat-interface.js:92244:5) at BrowserRouter (http://127.0.0.1:8080/amazon-connect-chat-interface.js:90950:5)

These errors don't seem to be an issue when building for prod npm install && npm run build, but their presence is concerning when developing. Would be nice to get rid of these errors for the dev builds too.

johnmryan commented 3 years ago

Hey @cmrockwell, thanks for filing this issue. I am looking into this. We removed localization code from this repo but it appears some components are still using the FormattedMessage type, which relies on having a localization provider exist in the component ancestry.

Luckily it should just be a console error, since it will fall back to the default message, but regardless we should clean this up. Will post back with an update.

johnmryan commented 3 years ago

@cmrockwell -- this issue should be resolved in the latest version. Let me know if it works for you.

cmrockwell commented 3 years ago

Looks good! Thanks