Skip to main content

I am trying to build custom react components with npm package 'box-ui-elements' repo (https://github.com/box/box-ui-elements).

When i try to import any of the elements (say content-explorer or content-picker) , i am getting the following error

 

./node_modules/box-ui-elements/es/components/time/ReadableTime.js
Attempted import error: 'FormattedRelative' is not exported from 'react-intl'

 

The import statement is as follows :


import ContentExplorer from 'box-ui-elements/es/elements/content-explorer/ContentExplorer';

 

Please suggest any solution.

Box UI Elements  


I was able to remove the error by installing the peer dependencies manually :

 

npm install node-sass axios classnames draft-js form-serialize jsuri pikaday react-animate-height react-intl@2.8.0 react-measure react-process-string react-router-dom react-tether react-textarea-autosize scroll-into-view-if-needed tabbable react-modal react-intl

 

https://community.box.com/t5/Platform-and-Development-Forum/Content-Preview-UI-Element-doesn-t-display-file-content-in/m-p/80911



This is very helpful!!



Reply