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:
Input Error: You must pass a valid list of files to parse
build.command failed
Error message
Command failed with exit code 1: npm run build
Input Error: You must pass a valid list of files to parse
build.command failed
Error message
Command failed with exit code 1: npm run build
Here are the build-related scripts in my package.json :
{
"scripts": {


"build": "npm-run-all copy:html build:*",
"preview": "astro preview",
"astro": "astro",
"build:sass": "sass --no-source-map src/styles/sass:public/css",
"copy:assets": "copyfiles -u 1 ./src/assets/**/* public",
"copy:html": "copyfiles -u 1 ./src/*.html public",
"copy": "npm-run-all --parallel copy:*",



"watch:sass": "sass --no-source-map --watch src/styles/sass:src/styles",



"build:astro": "astro build",
"postbuild": "postcss public/css/*.css -u autoprefixer cssnano -r --no-map"
}
}
{
"scripts": {


"build": "npm-run-all copy:html build:*",
"preview": "astro preview",
"astro": "astro",
"build:sass": "sass --no-source-map src/styles/sass:public/css",
"copy:assets": "copyfiles -u 1 ./src/assets/**/* public",
"copy:html": "copyfiles -u 1 ./src/*.html public",
"copy": "npm-run-all --parallel copy:*",



"watch:sass": "sass --no-source-map --watch src/styles/sass:src/styles",



"build:astro": "astro build",
"postbuild": "postcss public/css/*.css -u autoprefixer cssnano -r --no-map"
}
}
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
Kevin Powell
Kevin Powell2y ago
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:
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
},
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
},
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/#postcss
chr1swill
chr1swillOP2y ago
Thank 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.
Want results from more Discord servers?
Add your server