Error Uploading Pack

Greetings all! I have been using CLI to build some packs this week and I uploaded the first pack without any issue.

I have a second that is ready to upload and test but I am receiving an error that I feel certain is related to something I have done!

When I enter npx coda upload with the pack path, I receive an error that says:

TypeError: Cannot destructure property ‘formats’ of ‘manifest’ as it is undefined.
at compilePackMetadata (/Users/thomasbaucom/codapacks/orchestrate/node_modules/@codahq/packs-sdk/dist/helpers/metadata.js:7:13)
at Object.handleUpload [as handler] (/Users/thomasbaucom/codapacks/orchestrate/node_modules/@codahq/packs-sdk/dist/cli/upload.js:96:57)

Do I need to reinstall or delete something?

1 Like

Hi @Thomas_Baucom - I’ve never seen that error before, very interesting. It definitely seems to be an error in the Pack SDK code itself, but perhaps triggered by something you are doing. Are you create column formats at all in that Pack? Are you able to share your code?

I know from previous conversations that you ran into some transient errors before with the CLI. Have you tried uploading more than once? Have you tried re-installing the SDK?

1 Like

@Eric_Koleda Thanks for the quick reply. I am not creating any column formats and I am happy to share my code -

import * as coda from "@codahq/packs-sdk";
import { Interval, Note, Scale, Chord } from "@tonaljs/tonal";
import { Midi } from "@tonaljs/tonal";

export const pack = coda.newPack();

pack.addFormula({
    name: "ToMidi",
    description: "Finds notes for scale",
    parameters: [
      coda.makeParameter({
        type: coda.ParameterType.String,
        name: "note",
        description: "Note Name ex: C2, A4, Bb6, etc.",
      }),
    ],
  
    resultType: coda.ValueType.Number,
  
    execute: async function ([note], context) { 
      let result:any = Note.midi(note)
  
        return result

    },
  });
  pack.addFormula({
    name: "ToFreq",
    description: "Finds notes for scale",
    parameters: [
      coda.makeParameter({
        type: coda.ParameterType.String,
        name: "note",
        description: "Note Name ex: C2, A4, Bb6, etc.",
      }),
    ],
  
    resultType: coda.ValueType.Number,
  
    execute: async function ([note], context) { 
      let result:any = Note.freq(note)
  
        return result

    },
  });

I have attempted the upload a couple times and a reinstall and so far, the error is persisting.

@Eric_Koleda I deleted the folder and reinstalled everything and got it to upload just fine. My money is on something I did!

Glad you found a solution, but let me know if this happens again.

1 Like