#"n is not a function" error

23 messages · Page 1 of 1 (latest)

tired grail
#

I'm getting this strange error when I try to set the nav in my custom view. I'm not sure why.

...
...
    performWorkUntilDeadline (scheduler.development.js:45)```

Code:
```tsx YoutubeSyncView.tsx
import React from 'react'
import { YouTubeSyncClient } from './YouTubeSyncClient'
import { BackToAdmin } from './BackToAdmin'
import { DefaultTemplate } from '@payloadcms/next/templates'
import { Gutter, SetStepNav, StepNavItem } from '@payloadcms/ui'
import { AdminViewServerProps } from 'payload'

export const YouTubeSyncView: React.FC<AdminViewServerProps> = ({ initPageResult, params, searchParams}) => {
  if (!initPageResult.req.user) {
    return <p>You must be logged in to view this page.</p>
  }

  const steps: StepNavItem[] = [
    {
      url: '/admin',
      label: 'Dashboard',
    },
  ]

  return <DefaultTemplate
    i18n={initPageResult.req.i18n}
    locale={initPageResult.locale}
    params={params}
    payload={initPageResult.req.payload}
    permissions={initPageResult.permissions}
    searchParams={searchParams}
    user={initPageResult.req.user || undefined}
    visibleEntities={initPageResult.visibleEntities}
  >
      <SetStepNav nav={steps} />
    <Gutter>
      <BackToAdmin />
      <YouTubeSyncClient />
    </Gutter>
  </DefaultTemplate>
}

export default YouTubeSyncView
tired grail
#

Removing <SetStepNav /> fixes the error, but I know I need to set that to make sure clicking on my icon takes me back to the /admin route when I click on it from a custom view

cloud shard
#

WAIT

#

I think I have the answer for this actually

#

let me spin up one of my projects

#

I saw this and thought "a question from NLV, ain't no way I'm answering"

tired grail
cloud shard
#

I lied

#

I'm a lazy POS and I never set that up in my app

tired grail
#

all of my hopes have now been dashed

cloud shard
#

built a whole sales pipeline kanban custom view and I can't click the logo to get to /admin

#

idiot

#

clearly not getting into YC now

tired grail
#

you can still make it in if you can get to the bottom of it!

cloud shard
#

rip

tired grail
#

it seems to be something with my project. it works perfectly in a clean blank template

#

woooooould you believe me if I told you that it was because of a mismatch payload version

zinc yewBOT
cloud shard
#

no

#

but that's amazing