dogokit-beagle
dogokit-beagle copied to clipboard
Better Error Message in User Seed Process
Feature request
Is the feature request related to a problem? Please describe
This request is related to a problem in the initial DB seeding process.
If the user missed creating the prisma/credentials/users.ts
file, ti will throw
SyntaxError: The requested module './credentials/users' does not provide an export named 'dataCredentialUsers'
Instead of the error message that provided in here
if (!Array.isArray(dataCredentialUsers)) {
console.error(`🔴 [ERROR] Please create prisma/credentials/users.ts file`)
console.error(`🔴 [ERROR] Check README for the guide`)
return null
}
Describe the solution
Create the file with an empty array instead, and check if the array is empty or not. Then apply git ignore so there's no future update on that file.
Describe alternatives considered
A better way to detect the undeclared file maybe?