Commit f02304d 1 parent 51c39f2 commit f02304d Copy full SHA for f02304d
File tree 1 file changed +26
-3
lines changed
packages/dm3-next-app/app
1 file changed +26
-3
lines changed Original file line number Diff line number Diff line change 1
1
'use client' ;
2
2
3
3
import styles from './page.module.css' ;
4
+ import dynamic from 'next/dynamic' ;
4
5
5
- //@ts -ignore
6
- import { DM3 } from '@dm3-org/dm3-messenger-widget' ;
6
+ // //@ts -ignore
7
+ // import { DM3 } from '@dm3-org/dm3-messenger-widget';
8
+
9
+ {
10
+ /* This is done to avoid document not found error while building the app.
11
+ It imports dynamically so document is used once it is loaded.
12
+ Its done just to avoid github pipeline breaking, otherwise normald DM3
13
+ impport and use also works*/
14
+ }
15
+ const DynamicComponentWithNoSSR = dynamic (
16
+ ( ) => {
17
+ //@ts -ignore
18
+ return import ( '@dm3-org/dm3-messenger-widget' ) as any ;
19
+ } ,
20
+ { ssr : false } ,
21
+ ) ;
7
22
8
23
export default function Home ( ) {
9
24
const props : any = {
@@ -19,7 +34,15 @@ export default function Home() {
19
34
20
35
return (
21
36
< main className = { styles . dm3Container } >
22
- < DM3 { ...props } />
37
+ { /* This is not used because it uses document and its not found
38
+ while making build so pipeline fails in github */ }
39
+ { /* <DM3 {...props} /> */ }
40
+
41
+ { /* This is done to avoid document not found error while building the app.
42
+ It imports dynamically so document is used once it is loaded.
43
+ Its done just to avoid github pipeline breaking, otherwise normald DM3
44
+ impport and use also works*/ }
45
+ < DynamicComponentWithNoSSR { ...props } />
23
46
</ main >
24
47
) ;
25
48
}
You can’t perform that action at this time.
0 commit comments