Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Making a project inside a folder name with a # will throw "invalid container name" when using start-database.sh #1854

Closed
xelacast opened this issue Apr 27, 2024 · 0 comments

Comments

@xelacast
Copy link
Contributor

xelacast commented Apr 27, 2024

Provide environment information

NOTICE: I discovered that using a # in a folder name will trip out react and it will not be able to find any modules. Sorry about the issue bloat. I got ahead of myself.

System:
OS: macOS 14.4.1
CPU: (12) arm64 Apple M2 Pro
Memory: 85.20 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
pnpm: 9.0.4 - /opt/homebrew/bin/pnpm

Describe the bug

When creating an app with create-t3@latest inside a folder name with # will throw an "invalid name in container" error when using the

bash start-database.sh

script command. This is a valid issue for database container names. The special characters allowed in creating an app are '-' and '_' but that is only restricted when creating a new folder with the cli. This feature does not exist when you use the dot method when creating a new app directly in the parent folder.

Command line error:
bash start-database.sh
docker: Error response from daemon: Invalid container name (bug#1847-postgres), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed.
See 'docker run --help'.

Reproduction repo

https://github.com/xelacast/issue-1834

To reproduce

either pnpm create t3-app@latest inside a folder with a hashtag # in the name and do not specify a name. Then bash start-database.sh.

or

clone the repo.

git clone git@github.com:xelacast/issue-1834.git && bash start-database.sh

Another error occurs when you use the command the pnpm create t3-app@latest . command. The container name will be initialized to '.-postgres' and error with:

Error response from daemon: No such container: .-postgres
Error: failed to start containers: .-postgres
Existing database container '.-postgres' started

Additional information

If this is a valid bug, I propose to change how the container name is created for the start-database.sh file and find any invalid characters and change them with '-' or remove the space to improve the UX of the database startup process. Github removes invalid characters for repos and replaces them with the '-'. This happened for my reproduction repo name.

I'd appreciate the opportunity to implement this small feature. Thank you T3 team for creating a great tool!

@xelacast xelacast changed the title bug: Making a project name with a # will throw "invalid container name" when using start-database.sh bug: Making a project inside a folder name with a # will throw "invalid container name" when using start-database.sh Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants