Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "ReferenceError: true__options__ is not defined" #509

Merged
merged 1 commit into from Nov 28, 2022

Conversation

dschmidt
Copy link
Contributor

@dschmidt dschmidt commented Nov 11, 2022

No idea if this is the cleanest approach, but at least it fixes the following error for me:

 FAIL  packages/....spec.ts
  ● Test suite failed to run

    ReferenceError: true__options__ is not defined

This is caused by a missing newline before the __options__ in the generated code.

before:

var staticRenderFns = []
render._withStripped = true__options__.render = render
__options__.staticRenderFns = staticRenderFns

with this PR:

var staticRenderFns = []
render._withStripped = true
__options__.render = render
__options__.staticRenderFns = staticRenderFns

For the record: this is with Vue 2.7

@cjrh
Copy link

cjrh commented Nov 18, 2022

I am seeing this error too, but only on Github CI. On my dev machine, this doesn't happen. I'll add some info below, which I would normally add to an issue, but since there is no issue and only this PR I'll add here.

These are a few of the related Vue versions:

$ npm list | grep vue
├── @fortawesome/vue-fontawesome@2.0.8
├── @sentry/vue@7.17.3
├── @vue/devtools@6.4.5
├── @vue/server-test-utils@1.3.0
├── @vue/test-utils@1.3.3
├── @vue/vue2-jest@29.2.0
├── babel-preset-vue-app@2.0.0
├── eslint-plugin-vue@8.7.1
├── vue-docgen-api@4.54.2
├── vue-eslint-parser@9.1.0
├── vue-loader@15.9.8
├── vue-masonry-css@1.0.3
├── vue-meta@2.4.0
├── vue-multiselect@2.1.6
├── vue-nprogress@0.2.0
├── vue-popperjs@2.3.0
├── vue-resource@1.5.3
├── vue-router@3.6.5
├── vue-segment-analytics@0.5.4
├── vue-server-renderer@2.7.14
├── vue-simple-password-meter@0.1.0
├── vue-style-loader@4.1.3
├── vue-template-compiler@2.7.14
├── vue-virtual-scroll-list@2.3.4
├── vue@2.7.14
├── vue2-animate@2.1.4
├── vuex-router-sync@5.0.0
├── vuex@3.6.2

NPM is 8.1.0 and node is v16.13.0 (on both my dev machine and Github CI).

@dschmidt
Copy link
Contributor Author

Are you using a lockfile and the same versions on your dev machine and in CI?

@cjrh
Copy link

cjrh commented Nov 18, 2022

Absolutely. It's a real mystery.

@PKatrimoustakis
Copy link

I am running into the same issue in CI and the fix proposed here alleviates it. To reproduce it locally make sure you've cleared your Jest cache.

@cjrh
Copy link

cjrh commented Nov 25, 2022

Aha, the jest cache is why I got different results. Thank you @PKatrimoustakis

@lmiller1990
Copy link
Member

Nice job, I'll merge and release this for you once CI passes.

@lmiller1990 lmiller1990 merged commit 8c0e8bc into vuejs:master Nov 28, 2022
@lmiller1990
Copy link
Member

I released it, please give it a try: https://github.com/vuejs/vue-jest/releases/tag/v29.2.1

@dschmidt dschmidt mentioned this pull request Nov 28, 2022
10 tasks
@dschmidt
Copy link
Contributor Author

Works for us! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants