Like what we’re doing? Star us on GitHub!

build /admin/styles.css

ashermyers
4 weeks ago
21

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

  • thisisnotchris
    4 weeks 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?

  • ashermyers
    4 weeks 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)

  • thisisnotchris
    4 weeks ago

    Hmmm

  • ashermyers
    4 weeks 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

  • thisisnotchris
    4 weeks ago

    Can we see your config

  • ashermyers
    4 weeks 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'),
      },
    });
  • thisisnotchris
    4 weeks 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

  • ashermyers
    4 weeks ago

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

  • thisisnotchris
    4 weeks ago

    are any other assets returning a 404 status



    or is it this one stylesheet from what you can tell

  • ashermyers
    4 weeks ago

    No, just this one stylesheet

  • thisisnotchris
    4 weeks ago

    is the file in the out dist?



    or not created

  • ashermyers
    4 weeks ago

    gimme a sec. lemme check



    testing something rn

  • thisisnotchris
    4 weeks ago

    ok no rush



    im stuck at work all day

  • ashermyers
    4 weeks ago

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

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More