dogokit-beagle icon indicating copy to clipboard operation
dogokit-beagle copied to clipboard

Better Error Message in User Seed Process

Open esafirm opened this issue 1 year ago • 1 comments

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?

esafirm avatar Jan 31 '24 05:01 esafirm