Getting Payload Sass Error

default discord avatar
Luciano
10 months ago
8

Hello everyone,



Trust you are having a great day!



I'm getting this error & do not know how to solve it (Image also attached):



ERROR in ./node_modules/payload/dist/admin/scss/app.scss (./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[2].use[2]!./node_modules/sass-loader/dist/cjs.js!./node_modules/payload/dist/admin/scss/app.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
    ╷
180 │ @import '~payload-user-css';
    │         ^^^^^^^^^^^^^^^^^^^
    ╵
  node_modules/payload/dist/admin/scss/app.scss 180:9  root stylesheet

webpack compiled with 1 error


Any help would be appreciated.



Thank you very much for your time!

  • default discord avatar
    Jarrod
    10 months ago

    Are you attempting to import

    @import '~payload/scss';

    ?

  • default discord avatar
    Luciano
    10 months ago

    No, I am not

  • default discord avatar
    Jarrod
    10 months ago

    Are you importing one of your own css files, using a path alias? You will need to use relative paths for now. This is known shortcoming, the inability to use path aliases.

  • default discord avatar
    Luciano
    10 months ago

    Very interesting, I do not make use of path aliases. Is there a command I can run to see which file is causing this error?

  • default discord avatar
    Jarrod
    10 months ago

    Just looked at the code, are you using

    config.admin.css

    in your payload.config.ts to set a custom path for a css file?



    its saying that it cannot find

    that

    file/path

  • default discord avatar
    Luciano
    10 months ago

    You are awesome!



    I commented out my

    config.admin.css

    & everything works now.

  • default discord avatar
    seth
    8 months ago

    is the path alias problem throughout payload? I was just trying to set this up

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.