Error from node_modules es5-ext having # in file path

I keep getting a deployment error from my node_modules folder when trying to deploy a nextjs site with the netlify plugin.

Error: Deploy did not succeed: Invalid filename ‘node_modules/es5-ext/array/#/splice/shim.js’. Deployed filenames cannot contain # or ? characters

I’m not really sure how to fix this or if there is a workaround?

This happens when you’re trying to deploy the Node Modules folder itself. Are you sure you’re deploying the website correctly?

So I’m just using the standard next js deploy package that Netlify provides. There’s no node modules in the repo either. It does seem to succeed and then try to deploy node modules. But this is all done with that netlify nextjs package, is there a bug or setup that is undocumented?

Would you link to your repo or the package that you used to make sure we’re on the same page? I’d be happy to take a look at it.

So I followed this article using option two:

I installed this:

One thing I’m noticing is the article didn’t mention adding a netlify.toml file so I didn’t add it but the readme says you should, so I’m not sure if that is a requirement or this is pre-configured.

I can’t share the repo since it isn’t public but its really just nextjs standard with a prismic cms / slice machine integration. No api routes or anything I have it in serverless mode but again no netlify.toml file or package locally installed.

Ok so I got it to work by just manually installing it via the readme instructions. It seems like there is something off in the article information, perhaps the field for the build directory needs to have the string “out” in it rather than just being left blank but I’m not sure.

I had exactly the same issue. After a lot of debugging i saw that the build directory field was empty. After i manually added “out” everything was working.

Hi everyone,

This bug should now be fixed. Please let us know if you’re still encountering it. Thanks!

im still encountering this issue when i try and deploy my react app, it works perfectly fine if i drag and drop my build folder into the deploy area but whenever i try to add github its finding some magical folder that doesnt exist in ANY build which has illegal characters and fails to build, because of this im stuck manually updating the build

do you have a public repo we could take a look at, or a link to a failing build?