File tree Expand file tree Collapse file tree
apps/docs/snippets/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,10 +16,18 @@ export const DocCounter = ({ height = '350px' }) => {
1616 link . href = 'https://unpkg.com/superdoc@latest/dist/style.css' ;
1717 document . head . appendChild ( link ) ;
1818
19- const script = document . createElement ( 'script' ) ;
20- script . src = 'https://unpkg.com/superdoc@latest/dist/superdoc.umd.js' ;
21- script . onload = ( ) => setTimeout ( ( ) => initializeSuperdoc ( ) , 100 ) ;
22- document . body . appendChild ( script ) ;
19+ // Buffer polyfill — required by the UMD build for document hashing
20+ const bufferScript = document . createElement ( 'script' ) ;
21+ bufferScript . src = 'https://cdn.jsdelivr.net/npm/buffer@6/index.min.js' ;
22+ bufferScript . onload = ( ) => {
23+ window . Buffer = window . buffer . Buffer ;
24+
25+ const script = document . createElement ( 'script' ) ;
26+ script . src = 'https://unpkg.com/superdoc@latest/dist/superdoc.umd.js' ;
27+ script . onload = ( ) => setTimeout ( ( ) => initializeSuperdoc ( ) , 100 ) ;
28+ document . body . appendChild ( script ) ;
29+ } ;
30+ document . body . appendChild ( bufferScript ) ;
2331
2432 return ( ) => superdocRef . current ?. destroy ?. ( ) ;
2533 } , [ ] ) ;
You can’t perform that action at this time.
0 commit comments