jkcorrea / airtable-typegen

Generate TypeScript & Zod types from your Airtable bases
MIT License
21 stars 8 forks source link

Error: "Expected object, received string" on all uses #55

Open dslovinsky opened 5 months ago

dslovinsky commented 5 months ago

Hi! Thanks for making this, unfortunately I was not able to get it working. I tested on a large production Airtable base as well as a new Airtable with only a couple cells filled with text but kept getting the same error:

Fetching Airtable metadata
    ZodError: [
      {
        "code": "invalid_type",
        "expected": "object",
        "received": "string",
        "path": [],
        "message": "Expected object, received string"
      }
    ]

Steps to reproduce:

  1. Install with yarn add -D airtable-typegen
  2. Add AIRTABLE_TYPEGEN_ACCESS_TOKEN with read permission to .env
  3. Run airtable-typegen <BASE ID> on a minimal Airtable base

System info:

System Software Overview:

  System Version: macOS 13.5 (22G74)
  Kernel Version: Darwin 22.6.0
  Boot Volume: Macintosh HD
  Boot Mode: Normal
  Secure Virtual Memory: Enabled
  System Integrity Protection: Enabled
  Time since boot: 14 days, 2 hours, 1 minute

Hardware Overview:

  Model Name: MacBook Pro
  Model Identifier: Mac14,10
  Model Number: Z174000EBLL/A
  Chip: Apple M2 Pro
  Total Number of Cores: 12 (8 performance and 4 efficiency)
  Memory: 32 GB
  System Firmware Version: 8422.141.2
  OS Loader Version: 8422.141.2
ivanmatcuka commented 5 months ago

Did you make sure you gave access to the base when creating a token and setting its scope? Last section here:

Screenshot 2024-04-09 at 01 07 31
dslovinsky commented 5 months ago

Yes I did. Tried in a couple bases with a token with that scope added. One of the bases I used a token I regularly use with read access so I know it works.