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.

Getting Payload Sass Error

default discord avatar
realluciano2 years ago
7

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!

  • discord user avatar
    jarrod_not_jared
    2 years ago

    Are you attempting to import

    @import '~payload/scss';

    ?

  • default discord avatar
    realluciano2 years ago

    No, I am not

  • discord user avatar
    jarrod_not_jared
    2 years 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
    realluciano2 years 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?

  • discord user avatar
    jarrod_not_jared
    2 years 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
    realluciano2 years ago

    You are awesome!



    I commented out my

    config.admin.css

    & everything works now.

  • default discord avatar
    ssyberg2 years ago

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

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.