Failed during stage 'building site': Invalid filename ' '. Deployed filenames cannot contain # or ? characters

The website url would be https://hardcore-edison-dcfd9d.netlify.app/ however this will not work due to failed deployment.

I have read through all of the many threads related to “Deployed filenames cannot contain # or ? characters” and am still unable to find a solution.

I have tried switching the command to npm build with directory build and still failed.

I am trying to deploy from a github repository.

My Build settings are as follows:

Repository: github.com/Rinzler8806/scheduler-react
Base directory: Not set
Build command: Not set
Publish directory: Not set
Deploy log visibility: Logs are public
Builds: Active

I have left the base/publish directory and build command blank because my project contains two separate directories (client and server). I have successfully deployed in the past with these build settings as well.

When attempting to deploy I receive the following message:

9:49:57 PM: Failing build: Failed to build site

9:49:57 PM: Failed during stage ‘building site’: Invalid filename ‘client/node_modules/es5-ext/array/#/copy-within/is-implemented.js’. Deployed filenames cannot contain # or ? characters

The files can be found at this location: https://github.com/Rinzler8806/scheduler-react

I have made sure all of my react dependencies are installed correctly by running npm react-scripts.

I have run out of ideas at the moment as to what to try next. I would appreciate any and all assistance.

Hi @Rinzler8806

Technically you don’t need to build anything because you have a build directory under client. All you need to do it publish client/build.

However, if you wish to build fresh every time, this is what I did after cloning your repository.

  1. Remove node_modules directory. Not required. Netlify will install necessary modules.
  2. Set base directory to client
  3. Set build command to npm run build
  4. Set publish directory to client/build

Successfully deployed to reverent-thompson-8e35f6.netlify.app. See deploy log.

I don’t know if i’m too late to this but I just ran into this issues here’s what I did which fixed my issues

base directory : yourApps
build command : CI= npm run build
publish directory : yourApps/build
I used craco in my react apps because I needed it to work with Tailwind css , I don’t know if this will work for you , but that solution worked for me.

1 Like

Thanks for sharing, @Rankin154 :netliconfetti:

Thanks for the input @Rankin154. I previously tried the build command: CI= npm run build to no success.

Hello @coelmay. I removed my node_modules directory and followed the rest of the steps you have listed. It now says the site published successfully, however the link to the site pulls the page not found message.

https://616eda955dee3b1f7fc4796c--hardcore-edison-dcfd9d.netlify.app/

I am curious why this is - Do you have anything listed for the environment variables key/value? I left those fields blank.

Below is a ss of my most recent deploy. Note: I have also tried waiting a half hour for the website to load and still get the Page not found message.

It’s much easier if you share the link to a deploy log rather than a screenshot.

Having said that, the last line appears to say

Starting to deploy site from 'client'

rather than

Starting to deploy site from 'client/build'

as in the deploy log I shared.

If you navigate to https://616eda955dee3b1f7fc4796c–hardcore-edison-dcfd9d.netlify.app/build/ you will find your site published there (and not working.)

This indicates you did not set the publish directory as I set out in step 4.

Your solution is correct for deploying. Thanks for the help @coelmay

I kept messing with the deployment configuration because I was trying to get netlify to also host my express server, which through research I have come to the realization that netlify is a static host.

2 Likes