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
TypeError: str.replace is not a function in util/StringUtils.ts #2719
Comments
This true value looks realy weird... |
I've realized that if I give a name after -n to the file, this error doesn't appear, but I think it's bad. |
@sinner you have to specify name of migration you want to create.
|
FIX #2719 check provided name and give feedback if not.
It would be great to have a more helpful error message |
that should be handled and a proper message that migration name required should be provided instead of cryptic str replace error |
Any plan to do this ? |
Why isn't anyone tackling this problem? Not nice at all. |
I have a fairly simple fix for this; will put up a PR shortly once I figure out how to run tests locally for this repo 😅 |
enforce the type of the name argument in order to return a more useful error message when the user forgets to provide a migration name to the generate migration command Closes: typeorm#2719, typeorm#4798, typeorm#4805
…ssing name argument enforce the type of the name argument in order to return a more useful error message when the user forgets to provide a migration name to the generate migration command Closes: typeorm#2719, typeorm#4798, typeorm#4805
* fix: enforce name argument of migration generate command enforce the type of the name argument in order to return a more useful error message when the user forgets to provide a migration name to the generate migration command Closes: #2719, #4798, #4805 * fix: update error message text for generate migration command when missing name argument enforce the type of the name argument in order to return a more useful error message when the user forgets to provide a migration name to the generate migration command Closes: #2719, #4798, #4805 Co-authored-by: Akosua Asante <akosuaasante@gmail.com>
… (typeorm#6690) * fix: enforce name argument of migration generate command enforce the type of the name argument in order to return a more useful error message when the user forgets to provide a migration name to the generate migration command Closes: typeorm#2719, typeorm#4798, typeorm#4805 * fix: update error message text for generate migration command when missing name argument enforce the type of the name argument in order to return a more useful error message when the user forgets to provide a migration name to the generate migration command Closes: typeorm#2719, typeorm#4798, typeorm#4805 Co-authored-by: Akosua Asante <akosuaasante@gmail.com>
Hi I was facing the same issue while creating any new migration file. And it's resolved now after adding below lines of code in "util/StringUtils.js" file. if(typeOf str != "String){ |
Dont edit the source code. Just use the command as suggested |
any news on this? |
Indeed, the error message is a bit confusing and misleading, which makes it difficult to identify and resolve the underlying problem. |
Issue type:
[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[x]
postgres
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[x]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Steps to reproduce or a small repository showing the problem:
I've created an entity, so my User entity has the following structure:
When I tried to generate the proper migration for it running:
I'm receiving this response:
The text was updated successfully, but these errors were encountered: