Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

build /admin/styles.css

default discord avatar
ashermyers2 years ago
14

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

  • default discord avatar
    notchr2 years ago
    @864214921620357150

    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
    ashermyers2 years 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
    notchr2 years ago

    Hmmm

  • default discord avatar
    ashermyers2 years 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
    notchr2 years ago

    Can we see your config

  • default discord avatar
    ashermyers2 years 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
    notchr2 years 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
    ashermyers2 years 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
    notchr2 years ago

    are any other assets returning a 404 status



    or is it this one stylesheet from what you can tell

  • default discord avatar
    ashermyers2 years ago

    No, just this one stylesheet

  • default discord avatar
    notchr2 years ago

    is the file in the out dist?



    or not created

  • default discord avatar
    ashermyers2 years ago

    gimme a sec. lemme check



    testing something rn

  • default discord avatar
    notchr2 years ago

    ok no rush



    im stuck at work all day

  • default discord avatar
    ashermyers2 years ago

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

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.