[solved] I changed a prop type but getting mismatch error



  • Hey folks, I have a PWA and on one ‘page’ a component where I was previously passing in a string, but changed it to pass in a number. I updated the props definition in the component after I realized I forgot to, but I still get an error saying:
    “Invalid prop: type check failed for prop “crcl”. Expected String with value “57.3325”, got Number with value 57.3325.”

    The prop says:
        crcl: {
          type: Number
        },
    

    Am I forgetting something else too?

    OR— is my dev version not compiling correctly? Where do compiled dev files live, anyway?



  • @rconstantine put : in front of where you are passing the value and it must be in quotes

    :my-prop="57.3325"
    


  • I think I’m doing that:

    :crcl="estCrCl"
    

    Where estCrCl = 57.3325 as a number.



  • I have others in the same component definition that are working like this pair:

    patAge: {
          type: Number
        },
    
    :pat-age="selectedPat.age"
    


  • I suppose the question is: why does it say it expected a string? My definition says number.



  • Holy crap! The issue was my IDE stopped saving my changes!!! I closed it at the end of the work day yesterday and opened it today and all my changes are gone! I started making them over again, including the above, and it works just fine. Never had that happen before with WebStorm. Weird.



  • That is really weird!
    Glad you resolved it.


Log in to reply