passkit-generator: Error on regex of type /(\$.[^ \n]*)/ in changeMessage field

I have a pass the respects the schema outlined on the Apple Developer website and which I can successfully create with ./signpass -p <file> and also successfully verify with ./signpass -v <file>

Yet still when I try to generate this pass after following all the steps in the README I get this error when I try to generate the pass.

Error: Validation of pass type failed. Pass file is not a valid buffer or (more probabily) does not respect the schema. Refer to https://apple.co/2Nvshvn to build a correct pass.
    at readFile.then.passStructBuffer (~/node_modules/passkit-generator/src/pass.js:135:15)

This even happens with some of the Sample passes from the Apple website (Tutorial), e.g. the BoardingPass.pass.

I tried looking into the code but I can not determine at which step or part of the JSON file it fails and also the error message is not very specific. Is there any chance you know where this comes from or how I could fix this or determine where the error comes from?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 31 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Oh okay, now I got it. You are right.

I mean, for the second part, my doubt is: shouldn’t we uniform the way the package let to add placeholders? Like all with $ or none?

Exactly so the [A-Z] is the exactly one and the [A-Z0-9]* part is 0 or more which combined together gives the original 1 or more what we want.

Second part I am still not sure what your plans are sorry.

This is great and I agree with you about the last one but it is not clear to me yet why the positive lookahead.

Hi @alexander-san! Let’s find out! If the pass gives you that error, is because _validateType failed, and it can fail for two reasons:

  1. There is not a key called like one of the following ones: ["boardingPass", "eventTicket", "coupon", "generic", "storeCard"] in pass.json

  2. Schema validation really fails because you inserted a key not in the schema

Each field is an array of field.

You can check if your fields are compliant with the schema. Anyway, have you tried to start your node process with DEBUG=* before? If it is a schema problem, it will give you more details.

If you still cannot solve, can you pass me some pass models, like the Apple one, so I can check? It may also be a problem of the library, but who knows right now?

Let me know!