Next.js Discord

Discord Forum

nextjs adding space to url templates in docker build

Answered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
Hey folks!

We're experiencing a docker-specific build issue with next.js where spaces are being injected into URL path segments/templates, causing API route failures.

Does anyone have an idea what could be wrong here? Here is more about the issue https://github.com/jk-labs-inc/jokerace/issues/4229
Answered by Roseate Spoonbill
If I were to guess, one of the env variables during build have thespace added by mistake in workflow itself. I've done ton of builds in docker image, pipeline itself and live on servers and any cases like those were simply my dumb mistake of placing spaces in wrong places.

I'd look for places like this one and make sure these aren't evaluated with extra spaces:
View full answer

8 Replies

Transvaal lionOP
bump, anyone?
Roseate Spoonbill
If I were to guess, one of the env variables during build have thespace added by mistake in workflow itself. I've done ton of builds in docker image, pipeline itself and live on servers and any cases like those were simply my dumb mistake of placing spaces in wrong places.

I'd look for places like this one and make sure these aren't evaluated with extra spaces:
Answer
Roseate Spoonbill
(this is example taken from the code you referred to as breaking PR)
Note the spaces before $. I am not saying this is the source of problem, but definitely worth looking at.
Transvaal lionOP
it worked!!! thank youuuuu
Transvaal lionOP
let me know if there is a way to tip you either through github/coffee @Roseate Spoonbill
Roseate Spoonbill
@Transvaal lion That's very kind of you, but I don't have anything set up for tips. And it didn't take me that much time, so I wouldn't want you to 😉

However, if you'd like to return the favour, simply check out one of my latest projects - [Happy Changelog](https://happy-changelog.github.io/happy-changelog-website) - simplified changelog and version management flow for small projects and teams. I implemented it for GitLab and GitHub based on my experience working on automating project releasing. Maybe it would suit you, or maybe your friends would like to use something like this.

Don't feel like you need to use it, simply take a look and see if you like it. And if not, hit me up on PM and let me know what I could improve.