Support Forums

Deployed filenames cannot contain # or ? characters -- only my build doesn't contain those

I’m struggling with random Failed during stage 'deploying site': Invalid filename 'web/node_modules/hamljs/test/fixtures/issue.#8.html'. Deployed filenames cannot contain # or ? characters issues with Netlify deploys from Git commits.

It started yesterday, and I looked through the commit’s changes, none of which resulted in the creation of any files with hashes or question marks in their name either in the src or the dist.

Furthermore, I tried to re-deploy an older commit that had built just fine with Netlify’s “Retry deploy” clicky-button – and now that one is failing with this same error message even though it previously hadn’t.

And on top of that, if I use the Netlify CLI tool to build & deploy, even my current codebase deploys just fine.

It’s literally letting Netlify do the build and deploy as a CI step that’s randomly failing with this error message that surely couldn’t apply to me.

I Googled the error message, but there’s nothing but unfinished threads of people scratching their heads without resolution – that said, it seems to come up a lot in the world of Netlify.

How do I get un-stuck and able to deploy via Git-based CI again?

I figured it out!

I’m using a monorepo with /studio/ and /web/ folders for a Sanity 11ty project, and do I’m constantly toggling a comment on and off for build “base” in my “/web/netlify.toml” as I do “netlify dev” vs. “git push” so that each one behaves correctly.

I got my wires crossed and was leaving base = "./" active in my /web/netlify.toml while git pushing it. That’s when I needed to comment that line out so that Netlify itself would use my web directory as specified in the UI.

thanks for letting us know!! glad you figured it out :muscle: