I have narrowed down the error to the postscribe method. It produces the following error:
ReferenceError: window is not defined
Produced by the following code:
import { Card, Col, Row, Typography } from "antd";
import {} from "@ant-design/icons";
import postscribe from "postscribe";
type MyProps = {
}
type MyState = {
}
export default class Home extends Component<MyProps, MyState> {
componentDidMount = () => {
postscribe(
"#globe",
`
<script src="./js/threejs.js"></script>
<script src="./js/orbit-controls.js"></script>
<script src="./js/globe.js"></script>
`
);
};
render() {
return (
<>
<div id="globe" className="globeContainer peekaboo">
<canvas
width="700"
height="655"
className="w-lg-100 h-lg-100 w-75 h-75 me-lg-0 me-n10 mt-lg-5"
></canvas>
</div>
</>
);
}
}
what I've tried so far is wrapping the poscribe method with a window check:
if (typeof window !== "undefined") {
postscribe(
"#globe",
`
<script src="./js/threejs.js"></script>
<script src="./js/orbit-controls.js"></script>
<script src="./js/globe.js"></script>
`
);
}