build /admin/styles.css

default discord avatar
ashermyers
7 months ago
21

how do I build the styles? I'm running build and serve and /admin/styles.css is not building!

  • default discord avatar
    thisisnotchris
    7 months ago

    @ashermyers Is there any relevant information here?

    https://payloadcms.com/docs/admin/customizing-css#customizing-css-and-scss


    Have you defined a path for custom admin styles?

  • default discord avatar
    ashermyers
    7 months ago

    I'm not trying to add custom styles, the existing admin/styles.css is not loading, I'm getting a 404 error


    (Cannot GET /admin/styles.css)

  • default discord avatar
    thisisnotchris
    7 months ago

    Hmmm

  • default discord avatar
    ashermyers
    7 months ago

    I'm running:


    yarn copyfiles && yarn build:payload && yarn build:server


    and


    cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js NODE_ENV=production node dist/server.js

  • default discord avatar
    thisisnotchris
    7 months ago

    Can we see your config

  • default discord avatar
    ashermyers
    7 months ago
    import { buildConfig } from 'payload/config';
    import path from 'path';
    // import Examples from './collections/Examples';
    import Users from './collections/Users';
    
    export default buildConfig({
      serverURL: 'https://subdomain.example.org',
      admin: {
        user: Users.slug,
      },
      collections: [
        Users,
        // Add Collections here
        // Examples,
      ],
      typescript: {
        outputFile: path.resolve(__dirname, 'payload-types.ts'),
      },
      graphQL: {
        schemaOutputFile: path.resolve(__dirname, 'generated-schema.graphql'),
      },
    });
  • default discord avatar
    thisisnotchris
    7 months ago

    Also, this may be unrelated, but I've seen two suggestions regarding clearing the npm/yarn cache



    Seems odd that I'd see two suggestions regarding 404's on styles



    nothing looks weird there

  • default discord avatar
    ashermyers
    7 months ago

    I don't know if its something I'm doing since i'm just using the npx command and adding my mongodb config

  • default discord avatar
    thisisnotchris
    7 months ago

    are any other assets returning a 404 status



    or is it this one stylesheet from what you can tell

  • default discord avatar
    ashermyers
    7 months ago

    No, just this one stylesheet

  • default discord avatar
    thisisnotchris
    7 months ago

    is the file in the out dist?



    or not created

  • default discord avatar
    ashermyers
    7 months ago

    gimme a sec. lemme check



    testing something rn

  • default discord avatar
    thisisnotchris
    7 months ago

    ok no rush



    im stuck at work all day

  • default discord avatar
    ashermyers
    7 months ago

    got it working by building the css on another machine and copying it over. Weird...

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.