Node.js v6.2.0 class extends is not a function error?

后端 未结 2 1126
忘了有多久
忘了有多久 2020-12-20 11:20

So I\'m trying to extend a class in node js and the compiler keeps returning the following error:

TypeError: Class extends value # is not a fun         


        
      
      
      
2条回答
  •  悲&欢浪女
    2020-12-20 12:14

    So it turns out I had a circular reference in my code, where I was importing the class that was extending, into the class that itself was extending (tongue twister :P).

    The obvious fix was to simply remove the extends reference and find another way of doing what I was trying to achieve. In my case it was passing the Venue class properties down into the VenueViews constructor.

    E.g var x = VenueViews(this)

提交回复
热议问题