Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

afoysal's avatar

FullCalendar is not defined

I am trying to implement Laravel FullCalendar. My View file is like below

<!doctype html>

<html lang="en">

<head>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.2.7/fullcalendar.min.js"></script>

    <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.2.7/fullcalendar.min.css"/>

</head>

<body>

<div class="container">

    <div class="panel panel-primary">

        <div class="panel-heading">

            MY Calender    

        </div>

        <div class="panel-body" >

            {!! $calendar->calendar() !!}

            {!! $calendar->script() !!}

        </div>

    </div>

</div>

</body>

</html>

I am getting ReferenceError: FullCalendar is not defined error.

error

0 likes
9 replies
mvd's avatar

Hi @afoysal

What is the js output and source from

{!! $calendar->calendar() !!}

{!! $calendar->script() !!}

?

1 like
afoysal's avatar

Thanks @mvd. Which JS output would you like to see ? Thanks.

mvd's avatar

@afoysal

The JS/HMLT code from

{!! $calendar->calendar() !!}

{!! $calendar->script() !!}
1 like
afoysal's avatar

Thanks @siangboon for your reply. I am fighting with it for last 5 days. I read your link. There is no Laravel code.

Could you please help me to initialize it first with some sample code of Laravel ?

afoysal's avatar

How to get JS/ HTML code from below code ?

{!! $calendar->calendar() !!}

{!! $calendar->script() !!}

Here is a screenshot of inspector tab of firefox.

error

siangboon's avatar

my bad, {!! $calendar->script() !!} should equivalent to that part...

i just simply guess that you may mess up multiple versions....

if you using npm installation (and different version the steps may different also) you do not need to include the fullcalendar javascript into tag.. and i saw few of your post... you seem installed older version also...

i would suggest that you create a new project and try the script tag way by follow the doc from https://fullcalendar.io/docs/initialize-globals and make it work first then only decide whether go for npm installation....

1 like

Please or to participate in this conversation.