vuejs / component-compiler-utils

Lower level utilities for compiling Vue single file components
319 stars 75 forks source link

TypeError: Super Expression must either be null or a function #62

Closed dhershman1 closed 4 years ago

dhershman1 commented 5 years ago

I made this same issue on the require-extension-hooks-vue repo. Since I don't know quite where this falls under.

It seems like maybe prettier but I am unsure since it may also be related to Vue?

I am using the hooks repo to setup and run unit tests, however I keep getting this same type error of Super Expression must either be null or a function

I'm not sure why this started happening. You can reproduce it if you simply clone the require-extension-hooks-vue repo here: https://github.com/jackmellis/require-extension-hooks-vue

Any pointers or a possible work around would be greatly appreciated! Maybe I'm just being dumb even I dunno.

sodatea commented 5 years ago

From the error message, I guess it's the same problem as https://github.com/vuejs/vue-test-utils/issues/936

Two possible workarounds:

  1. add window.Date = Date to your test setup.
  2. set the prettify option to false when calling compileTemplate
dhershman1 commented 5 years ago

From the error message, I guess it's the same problem as vuejs/vue-test-utils#936

Two possible workarounds:

1. add `window.Date = Date` to your test setup.

2. set the `prettify` option to false when calling `compileTemplate`

Thank you, I will check those out asap.

EDIT: Adding the first suggestion (window.Date = Date) to the setup seems to have gotten me past this initial error. To what appears to be actual test errors now, which is a good thing!