ljlm0402 / typescript-express-starter

📘 Quick and Easy TypeScript Express Starter
http://npm.im/typescript-express-starter
MIT License
2.71k stars 419 forks source link

Knex migration using initial migration example not working #243

Open roycechua opened 8 months ago

roycechua commented 8 months ago

Describe the Bug (버그 설명)

Unable to do do knex migration on initial generated template with knex. Running npm run migrate produced an error

Version to Reproduce (현재 사용한 버전)

knex: 2.2.0
ts-node: 10.9.1
typescript: 4.7.4

Steps to Reproduce (재현 순서)

  1. Generate a new template
  2. Select knex
  3. Open a terminal and navigate to the template
  4. Run npm install (if node_modules hasn't been installed already)
  5. Run docker compose up
  6. Once environment is setup, run knex migration with npm run migrate
  7. Error should be encountered at this point

Expected Behavior (예상 동작)

Migration should happen without any errors like this

Screenshot 2024-02-27 at 9 18 06 PM

Actual Behavior (실제 동작)

From the generation of the template (using knex) On running the command npm run migrate, I encountered this error

Screenshot 2024-02-27 at 9 17 29 PM

I identified the fix for this but encountered another error on the migration

Screenshot 2024-02-27 at 9 17 49 PM

So there are really 2 problems, and here is a PR I made if you want to consider my small fix

Additional Context (추가 사항)

Might be related to how knex and TS in terms of handling exports