why is yarn failing to load

66 views Asked by At

making a schedule extension, but I'm getting this:enter image description here

My problem is, I'm trying to get it to work with the google calendar
api, but I cant seem to find out what is wrong
here is my code:

import React, {useEffect, useState, useContext} from "react"
import { Global } from '@emotion/core'
import ical from 'ical';
import {MyThemeContext} from '../contexts/theme-context'
import EventList from '../components/event-list'


const HomePage = () => {
    const [cal, setCal] = useState(null)
    const streamerName = "bobrossrtx"
    const {theme } = useContext(MyThemeContext)

    useEffect(() => {
      const fetchCal = async () => {
          const parsed = await ical.fromURL(
            'https://calendar.google.com/calendar/ical/5gvmiv5v1qblaoptns3p0avhs0%40group.calendar.google.com/public/basic.ics'
          );

          setCal(parsed);
        };

        fetchCal();
    }, [])

    return (
        <>
        <Global styles={{body: { backgroundColor: theme.colors.background}}} />
    <main>
<h1>{streamerName}'s Calendar</h1>
        <EventList events={[{
            id:0,
            title:"Create a Twitch Extension with Darrik Moberg",
            date: new Date('November 25, 2019 10:30:00'),
            description: "If you want to show specific information on a Twitch profile, how do you do that? In this episode, Learn With Jason moderator Darrik Moberg (https://twitter.com/MDarrik) teaches us how to create custom extensions for Twitch that work on both the website and apps."
        }]} />
        <pre>{JSON.stringify(cal, null, 2)}</pre>
    </main>
    </>
)}

export default HomePage
0

There are 0 answers