nhn / tui.calendar

🍞📅A JavaScript calendar that has everything you need.
http://ui.toast.com/tui-calendar
MIT License
12k stars 1.29k forks source link

window ist not defined #525

Closed mayrhueli closed 4 years ago

mayrhueli commented 4 years ago

Version

Development Environment

Chrome, MacOS, NodeJs

Current Behavior

I tried to "include" the TUI calender into my WEB Project but is always throws the exception: windoe is not defined when I try to run the Example code

var Calendar = require('tui-calendar'); 

Exception: }) (window, function(WEBPACK_EXTERNAL_MODULE_tui_code_snippet, WEBPACK_EXTERNAL_MODULE_tui_date_picker) { ^

this is my first issue ever - so hope I gave enough information thanks

dongsik-yoo commented 4 years ago

511 might be helpful for you. And check dependency packages of Calendar if you use package manager(npm, yarn)

tingll99 commented 4 years ago

I'm encountering the same issue and I installed snippets, date_picker and time_picker

Version

Development Environment

Chrome, Windows 10, nodeJS

Current Behavior

var Calendar = require('tui-calendar'); require("tui-calendar/dist/tui-calendar.css");

C:\Users\Lyle Tingle\Documents\GitHub\SD-D-Project\node_modules\tui-calendar\dist\tui-calendar.js:16 })(window, function(WEBPACK_EXTERNAL_MODULE_tui_code_snippet, WEBPACK_EXTERNAL_MODULE_tui_date_picker) { ^

ReferenceError: window is not defined at Object. (C:\Users\Lyle Tingle\Documents\GitHub\SD-D-Project\node_modules\tui-calendar\dist\tui-calendar.js:16:4) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Module.require (internal/modules/cjs/loader.js:1044:19) at require (internal/modules/cjs/helpers.js:77:18) at Object. (C:\Users\Lyle Tingle\Documents\GitHub\SD-D-Project\server.js:5:16) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)

stale[bot] commented 4 years ago

This issue has been automatically marked as inactive because there hasn’t been much going on it lately. It is going to be closed after 7 days. Thanks!

stale[bot] commented 4 years ago

This issue will be closed due to inactivity. Thanks for your contribution!

reinaldoamaralstudio commented 4 years ago

Thanks!

https://reinaldoamaral.net/galeria/index.php/home/brasil-central https://reinaldoamaral.net/galeria/index.php/home/brasil-central

Em 11/04/2563 BE, à(s) 03:37, stale[bot] notifications@github.com escreveu:

Closed #525 https://github.com/nhn/tui.calendar/issues/525.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nhn/tui.calendar/issues/525#event-3223736568, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKFS5EI6RVPT6G327SOJAALRMAF4HANCNFSM4K5O446A.

harshith-venkatesh commented 2 years ago

Is there anyone who resolved the above issue? I am facing this issue in remix

adhrinae commented 2 years ago

@harshith-venkatesh

The calendar does not support SSR yet, so you need to handle browser-only codes by yourself. There's documentation about this issue in Remix.

https://remix.run/docs/en/v1/guides/constraints#browser-only-code-on-the-server

DeRaowl commented 2 years ago

Hi Team, I found the solution for the above problem. Basically while @toast-ui/react-calendar package, we can name the file as .client.tsx extension which makes file to render at client end.

harshith-venkatesh commented 2 years ago

Thank you @adhrinae @DeRaowl for the help and support 👍

raverecursion commented 2 years ago

in Nextjs just use dynamic import and disable ssr like this: import dynamic from 'next/dynamic' const Calendar = dynamic(() => import('../components/Calendar/Calendar'), { ssr: false, })