Hi!
Frontity rookie here. I developed this project last year and it has been working rather smoothly until yesterday or so. Itās hosted on Vercel that says āInternal Server Errorā and the function logs tell me āError: TypeError: Cannot read property āundefinedā of undefinedā. Running it locally gives me āTypeError: Cannot read properties of undefined (reading āundefinedā) at LandingPageā and I donāt really know where this is coming from.
My LandingPage looks like this:
import React from "react"
import { connect, styled } from "frontity"
const MainContainer = styled.main``
const LandingPage = ({ state, libraries }) => {
const data = state.source.get(state.router.link)
const page = state.source[data.type][data.id]
const Html2React = libraries.html2react.Component
return (
<MainContainer>
<Html2React html={page.content.rendered} />
</MainContainer>
)
}
export default connect(LandingPage)
and itās being mounted in my TopMain (donāt blame me for the naming) like this:
const TopMain = ({ state }) => {
const data = state.source.get(state.router.link)
return (
<>
<Switch>
{data.link === "/" ? (<LandingPage />)
:
(<>
<Header />
<Main />
<Footer />
</>)
}
</Switch>
</>
)
}
export default connect(TopMain)
When I log the
const data = state.source.get(state.router.link)
I get error 406, so does this mean the issue has to do with fetching from WordPress? Does anyone have a suggestion on how I start debugging this?
Links
System info
System:
- OS: macOS 11.3
- CPU: (8) x64 Intel(R) Coreā¢ i5-8257U CPU @ 1.40GHz
- Memory: 59.80 MB / 16.00 GB
- Shell: 5.8 - /bin/zsh
Binaries:
- Node: 16.14.2 - /usr/local/bin/node
- npm: 8.5.0 - /usr/local/bin/npm
Browsers:
- Chrome: 100.0.4896.127
- Edge: 100.0.1185.50
- Firefox: 99.0.1
- Safari: 14.1
npmPackages:
- @aamodtgroup/frontity-contact-form-7: git+https://github.com/HIPPIEKICK/frontity-contact-form-7.git => 0.2.6
- @daily-co/daily-js: ^0.13.0 => 0.13.0
- @frontity/core: ^1.13.0 => 1.15.1
- @frontity/html2react: ^1.6.2 => 1.7.0
- @frontity/tiny-router: ^1.4.2 => 1.4.4
- @frontity/wp-source: ^1.11.4 => 1.11.7
- @orballo/very-tiny-router: ^0.1.2 => 0.1.2
- dayjs: ^1.10.4 => 1.10.4
- frontity: 1.15.0 => 1.15.0 (1.17.2)
- nkjt-theme: file:packages/nkjt-theme => 1.0.0
- react-router-dom: ^5.2.0 => 5.2.0
npmGlobalPackages:
- frontity: Not Found
- npx: Not Found