So I want to include a favicon generated by RealFavIconGenerator.net but in just adding the that comes with Frontity, I get the error āCannot read property āaddā of undefinedā. Here is the code:
import React from 'react'
import {connect, Global, css, styled, Head} from 'frontity'
import Switch from '@frontity/components/switch'
import Header from './global/header'
import Footer from './global/footer'
import Loading from './loading'
import Home from './home'
import Post from './post'
import PageError from './page-error'
const Root = ({state, theme}) => {
const data = state.source.get(state.router.link)
return (
<>
<Head>
<title>{state.frontity.title}</title>
<meta name="description" content={state.frontity.description} />
<html lang="en" />
<link rel="canonical" href={state.router.link} />
</Head>
<Global
styles={css`
@import url("https://use.typekit.net/tdr5ulz.css");
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
#root {
font-family: century-gothic, sans-serif;
font-style: normal;
font-weight: 400;
color: ${theme.colors.dark};
background: ${theme.colors.light};
line-height: 1.5;
letter-spacing: 1px;
display: flex;
min-height: 100vh;
flex-direction: column;
}
h2 {
text-align: center;
margin-bottom: 1.5rem;
font-weight: 400;
font-size: 2.5rem;
${theme.breakPoints.mobile} {
font-size: 1.5rem;
}
&:after {
content: "";
clear: both;
display: block;
width: 5rem;
margin: 0.5rem auto;
border-bottom: ${theme.colors.primary} 1px solid;
}
}
h3 {
text-align: center;
color: ${theme.colors.primary};
font-weight: 400;
font-size: 1.25rem;
}
button, a {
border: 0;
outline: 0;
&::-moz-focus-inner {
border: 0;
}
}
button {
font-family: sans-serif;
}
a {
text-decoration: none;
transition: 0.125s all ease-in-out;
color: ${theme.colors.dark};
font-weight: bold;
&:visited {
color: ${theme.colors.dark};
}
&:active, &:hover, &:focus {
color: ${theme.colors.primary};
}
}
img {
max-width: 100%;
}
`}
/>
<Header />
<SiteContent theme={theme}>
<Switch>
<Loading when={data.isFetching} />
<Home when={data.isHome} />
<Post when={data.isPostType} />
<PageError when={data.isError} />
</Switch>
</SiteContent>
<Footer />
</>
)
}
export default connect(Root)
const SiteContent = styled.main`
flex: 1;
margin-top: 5rem;
${props => props.theme.breakPoints.navbar} {
margin-top: 3rem;
}
`
If I remove <Head>
, itāll work no problem. If I empty <Head>
, it breaks still. I am using frontity-head-tags
and the WP REST - Head Tags plugin to get head tags from WordPress, could that be the problem?
Here is my system information:
## System:
- OS: Linux 5.4 Pop!_OS 20.04 LTS
- CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
- Memory: 15.05 GB / 31.22 GB
- Shell: 5.0.16 - /bin/bash
## Binaries:
- Node: 10.21.0 - ~/n/bin/node
- npm: 6.14.4 - ~/n/bin/npm
## Browsers:
- Chrome: 83.0.4103.116
- Firefox: 78.0.1
## npmPackages:
- @frontity/core: ^1.7.2 => 1.7.2
- @frontity/head-tags: ^1.0.4 => 1.0.4
- @frontity/html2react: ^1.3.4 => 1.3.4
- @frontity/tiny-router: ^1.2.1 => 1.2.1
- @frontity/wp-source: ^1.8.0 => 1.8.0
- frontity: ^1.10.0 => 1.10.0
- interpayments-theme: file:packages/interpayments-theme => 1.0.0
## npmGlobalPackages:
- frontity: Not Found
- npx: Not Found
System info copied in the clipboard!
You can now paste it in the Frontity Community or GitHub issue.