Hi everyone. I’, relatively new in React and I’ve just started working with Box integration. I managed to use Box by referencing the versions available on Box's CDN (https://github.com/box/box-content-preview?tab=readme-ov-file#including-preview-as-a-library). But, I have the requirement to use it as a NPM package. I’m using React and when I try to install the box-ui-elements and use it, I get the error
100:30:52 [vite] error while updating dependencies:2Error: Build failed with 3 errors:3node_modules/box-ui-elements/es/elements/content-preview/ContentPreview.js:51:26: ERROR: No matching export in "node_modules/box-ui-elements/es/elements/common/annotator-context/index.js" for import "WithAnnotationsProps"4node_modules/box-ui-elements/es/elements/content-preview/ContentPreview.js:51:70: ERROR: No matching export in "node_modules/box-ui-elements/es/elements/common/annotator-context/index.js" for import "WithAnnotatorContextProps"5node_modules/box-ui-elements/es/elements/content-sidebar/ActivitySidebar.js:26:9: ERROR: No matching export in "node_modules/box-ui-elements/es/elements/common/annotator-context/index.js" for import "WithAnnotatorContextProps"6 at failureErrorWithLog (C:\Users\Vd88\Documents\Projects\BoxContentPreview\box-content-preview-demo\node_modules\esbuild\lib\main.js:1472:15)7 at C:\Users\Vd88\Documents\Projects\BoxContentPreview\box-content-preview-demo\node_modules\esbuild\lib\main.js:945:258 at C:\Users\Vd88\Documents\Projects\BoxContentPreview\box-content-preview-demo\node_modules\esbuild\lib\main.js:1353:99 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Maybe I’m doing something wrong, maybe this issue is trivial for resolving, but I still haven’t found a way to overcome this.
I have found similar questions (like this one) and sample codes (like this one
) https://github.com/box-community/ui-elements-demo), but I still haven’t found the solution for my issue.
This is my code:
1import "./App.css";2import ContentPreview from "box-ui-elements/es/elements/content-preview";3import IntlProvider from "react-intl";45function App() {6 return (7 <IntlProvider locale="en">8 <ContentPreview9 contentSidebarProps={{10 detailsSidebarProps: {11 hasAccessStats: true,12 hasClassification: true,13 hasNotices: true,14 hasProperties: true,15 hasRetentionPolicy: true,16 hasVersions: true,17 },18 features: FEATURES,19 hasActivityFeed: true,20 hasMetadata: true,21 hasSkills: true,22 hasVersions: true,23 }}24 hasHeader={true}25 features={FEATURES}26 fileId={FILE_ID}27 token={TOKEN}28 {...PROPS}29 />30 </IntlProvider>31 );32}33And this is a code for the whole sample project:
https://github.com/vladimird88/box-ui-elements-sample
Can someone help me with this?
Thanks in advance.

