Netlify deploy failing with error, check description
Description: Click here for codebase on GitHub: https://github.com/chr1swill/https---github.com-chr1swill-astro-blog-website/issues/1
Hello,
I am using Astro, SCSS, CSS, JavaScript and markdown for my static site. I am running into a problem when trying to deploy my site on Netlify. The deploy command 'npm run build' is failing with below error:
Here are the build-related scripts in my
package.json
:
Troubleshooting Attempts
I've tried checking my scripts and file structure, and modifying build scripts, but with no success.
Environment
- Operating System: Windows 10 Version 22H2 (OS Build 19045.3208)
- Programming Language and Tools: JavaScript, Node.js(v19.9.0), HTML, CSS, Markdown
- Framework, Libraries, Preprocessors: Astro and SCSS
- Dependency Manager: Node Package Manager(9.7.2)
- Hardware Information: Processor AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx 2.10 GHz, Installed RAM 8.00 GB (5.94 GB usable), System type 64-bit operating system, x64-based processor
Does anyone have any idea about this error and how it can be fixed?
Thank you.GitHub
Netlify deploy failing with error: 'Input Error: You must pass a va...
Description Hello, I am using Astro, SCSS, CSS, JavaScript and markdown for my static site. I am running into a problem when trying to deploy my site on Netlify. The deploy command 'npm run bui...
2 Replies
Since you're using Astro, you generally want to allow it to do everything for you.
It looks like you had a bit of a custom build going on that you added Astro on top of it?
Astro can do the Sass work and everything else you need it to (well, Vite does, which Astro runs on).
So, the
build
command should simply be astro build
. This has to be in the build step, as it generates all the static pages and assets that you need.
If you did an npm i sass -D
when you brought in Sass (which it looks like you would have), then Vite knows youre using Sass and should handle that side as well, though you mighth have to make a few changes (like, in your HTML or .astro files, you'll actually link to your main .scss
file, which Vite then sees, and it compiles it and updates the link on it's own when the site is built).
I'd probably update things to look something like this:
PostCSS also comes with Vite (which, again, Astro is running on top of). Instead of having that run using scripts, you just need to setup a postcss config file to tell it what you want to use. There's info in the Astro documentation on that here: https://docs.astro.build/en/guides/styling/#postcssThank you for such a detailed reply, as soon as get back to my laptop I will implement these changes and update you with how it turned out
I used pretty much you same snippets and in my package.json and it work so thanks again for you time.