Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'active_workflows' of undefined #1694

Closed
sentry-io bot opened this issue Jun 29, 2020 · 3 comments · Fixed by #1964
Closed

TypeError: Cannot read property 'active_workflows' of undefined #1694

sentry-io bot opened this issue Jun 29, 2020 · 3 comments · Fixed by #1964
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@sentry-io
Copy link

sentry-io bot commented Jun 29, 2020

Sentry Issue: FEM-APP-PROJECT-98

TypeError: Cannot read property 'active_workflows' of undefined
  at HeroContainer_storeMapper (/usr/src/packages/app-project/.next/server/static/DebAPKhRjlAP6tKPCB3DQ/pages/projects/[owner]/[project].js:2004:48)
  at Injector.render (/usr/src/packages/app-project/node_modules/mobx-react/index.js:645:33)
  at Object.allowStateChanges [as _allowStateChanges] (/usr/src/packages/app-project/node_modules/mobx/lib/mobx.js:974:15)
  at None (/usr/src/packages/app-project/node_modules/mobx-react/index.js:851:28)
  at trackDerivedFunction (/usr/src/packages/app-project/node_modules/mobx/lib/mobx.js:764:24)
...
(23 additional frame(s) were not displayed)

We should not attempt to request for workflows when the project is not found and instead route to a 404 page with a user friendly error message.

@srallen srallen added bug Something isn't working good first issue Good for newcomers labels Jun 29, 2020
@eatyourgreens
Copy link
Contributor

The code that loads a project does it via a throwaway instance of a store, which is odd.

const { owner, project } = context.query
if (owner && project) {
const projectSlug = `${owner}/${project}`
const query = (context.query.env) ? { env: context.query.env } : {}
await store.project.fetch(projectSlug, query)
pageProps.initialState = getSnapshot(store)
}

It might be better to move data loading into getServerSideProps(request, response) and send back a 404 response if the project doesn't exist. I'm not sure what (if anything) that would break.

@eatyourgreens
Copy link
Contributor

See #1823.

@eatyourgreens
Copy link
Contributor

See vercel/next.js#11644 for code that sends a 404 response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants