0

I am trying to deploy React application to CloudFlare pages. Before that I deployed it on GitHub pages and everything is working fine.

When I try to deploy on CloudFlare this is the error I got:

SassError: Can't find stylesheet to import.

18:17:14.016 ╷ 18:17:14.016 4 │ @import "../components/homepage/header/header.scss"; 18:17:14.017 │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 18:17:14.017 ╵ 18:17:14.018 src/styles/main.scss 4:9 root stylesheet

Anyone know what is the issue?

I tried setting absolute path also: @import "components/homepage/header/header.scss"; but it didn't help.

Zoran
  • 17
  • 3

1 Answers1

1

Difficult to troubleshoot without your project structure, but:

  • Path typo.
  • You may have changed capitalization at some point, so it won't recognize the new one.

Try changing the name of the file to something different, and re-import it.

SidMcHeath
  • 61
  • 4
  • Hi, no there is no type, when I run npm run build everything works fine so something is working different on CloudFlare pages. – Zoran Jul 14 '23 at 17:21
  • Try setting webpackImporter: false, in your sass-loader options. See here: https://github.com/webpack-contrib/sass-loader/issues/804#issuecomment-586095020 – SidMcHeath Jul 14 '23 at 17:25