Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError: window is not defined #61

Open
KatyHwang opened this issue Sep 29, 2020 · 2 comments
Open

ReferenceError: window is not defined #61

KatyHwang opened this issue Sep 29, 2020 · 2 comments

Comments

@KatyHwang
Copy link

I am using the nextjs , the chart cannot show .

error msg:

Server Error
ReferenceError: window is not defined

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Source
external%20%22react-gantt-timeline%22 (1:0) @ Object.react-gantt-timeline

1 | module.exports = require("react-gantt-timeline");
Call Stack
webpack_require
webpack\bootstrap (21:0)
Show collapsed frames
擷取

@KatyHwang
Copy link
Author

ReferenceError: window is not defined
at Object. (C:\Users\katy\source\react\shipDemo\node_modules\react-gantt-timeline\dist\index.js:1:421)

@kdoroszewicz
Copy link

I encountered the same problem @KatyHwang. You can work around it by using Dynamic Import:

import dynamic from "next/dynamic";
const TimeLine = dynamic(() => import("react-gantt-timeline"), { ssr: false });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants