#Missing '@payloadcms/next/css'

13 messages · Page 1 of 1 (latest)

brazen moat
#

I'm getting Payload set up, and there seems to be an issue because the @midnight night/next/css module is no longer included. I've tried a lot of things, and cannot seem to fix this/find it.

This missing module causes my production build to error out, and therefore it will not deploy on Vercel. The module is important for styling the Payload dashboard. Without it, the dashboard has no CSS.

See image. Should be a simple fix. I used Payload maybe a year ago and never ran into this issue.

wicked osprey
#

Hey @brazen moat a few questions to narrow this down:

  • is this a fresh install from npx create-payload-app?
  • Are you using one of our templates?
  • What is your Payload version?
brazen moat
#

Yes, fresh install. Using the blank template, but also tried the website template. Payload v3.83.0

wicked osprey
#

hmm interesting, I will try to reproduce

brazen moat
#

Yes, it is very weird. I mean the @midnight night/next/css module is not there so I understand the concern, but in development locally everything is fine

deep shell
frail bluff
#

You shouldn't import css file in route.ts, move that to admin/layout.ts

wicked osprey
#

this is a valid bug! There is an open issue for it, but in the meantime you can add a declare in your environment.d.ts

declare global {
  namespace NodeJS {
    interface ProcessEnv {
      PAYLOAD_SECRET: string
      DATABASE_URL: string
      NEXT_PUBLIC_SERVER_URL: string
      VERCEL_PROJECT_PRODUCTION_URL: string
    }
  }
}

declare module '@payloadcms/next/css'

// If this file has no import/export statements (i.e. is a script)
// convert it into a module by adding an empty export statement.
export {}
brazen moat
wicked osprey
#

you shouldn't need to add it to your ts config as its a .ts it'll be picked up automatically

#

can you show me your environment.d.ts file?