Vue-cli: Cannot assign to read only property 'Symbol(Symbol.toStringTag)' of object '#<process>'

Created on 14 Mar 2019  路  7Comments  路  Source: vuejs/vue-cli

Version

3.5.1

Environment info

  System:
    OS: macOS 10.14.3
    CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
  Binaries:
    Node: 11.11.0 - /usr/local/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.7.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 72.0.3626.121
    Firefox: 64.0
    Safari: 12.0.3
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0-beta.2
    @vue/babel-plugin-transform-vue-jsx:  1.0.0-beta.2
    @vue/babel-preset-app:  3.5.1
    @vue/babel-preset-jsx:  1.0.0-beta.2
    @vue/babel-sugar-functional-vue:  1.0.0-beta.2
    @vue/babel-sugar-inject-h:  1.0.0-beta.2
    @vue/babel-sugar-v-model:  1.0.0-beta.2
    @vue/babel-sugar-v-on:  1.0.0-beta.2
    @vue/cli-overlay:  3.5.1
    @vue/cli-plugin-babel: ^3.5.0 => 3.5.1
    @vue/cli-plugin-e2e-nightwatch: ^3.5.0 => 3.5.1
    @vue/cli-plugin-eslint: ^3.5.0 => 3.5.1
    @vue/cli-plugin-unit-jest: ^3.5.0 => 3.5.1
    @vue/cli-service: ^3.5.0 => 3.5.1
    @vue/cli-shared-utils:  3.5.1
    @vue/component-compiler-utils:  2.6.0
    @vue/eslint-config-standard: ^4.0.0 => 4.0.0
    @vue/preload-webpack-plugin:  1.1.0
    @vue/test-utils: 1.0.0-beta.29 => 1.0.0-beta.29
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^5.0.0 => 5.2.2
    jest-serializer-vue:  2.0.2
    vue: ^2.6.6 => 2.6.9
    vue-eslint-parser:  5.0.0
    vue-hot-reload-api:  2.3.3
    vue-jest:  3.0.4
    vue-loader:  15.7.0
    vue-router: ^3.0.1 => 3.0.2
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.5.21 => 2.6.9
    vue-template-es2015-compiler:  1.9.1
    vuex: ^3.0.1 => 3.1.0
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

Create a standard Vue Project with Jest as the unit test framework. The sample test will fail with the following message.

Test suite failed to run

TypeError: Cannot assign to read only property 'Symbol(Symbol.toStringTag)' of object '#<process>'

  at exports.default (node_modules/jest-environment-jsdom/node_modules/jest-util/build/create_process_object.js:15:34)

What is expected?

test to pass

What is actually happening?

Test suite failed to run

TypeError: Cannot assign to read only property 'Symbol(Symbol.toStringTag)' of object '#<process>'

  at exports.default (node_modules/jest-environment-jsdom/node_modules/jest-util/build/create_process_object.js:15:34)

I believe this is related to the newest version of node (11.11.0) and has been addressed by Facebook as part of Jest 24.5.0 release (https://github.com/facebook/jest/commit/800f2f803d01c8ae194d71b251e4965dd70e5bf2)

Also posted in React Git Issue log: https://github.com/facebook/create-react-app/issues/6591

Most helpful comment

had the same issue, solved when updating node to v11.12.0

All 7 comments

+1
I've also just started experiencing this when trying to run jest in both a Vue CLI project and a NestJS Project shortly after upgrading yarn.

Experiencing the same issue after switching to yarn in my create react app application. Using React instead of Vue

We've exactly the same error, and waiting for an update of the dependencies (node/jest is already updated, which will fix this error)

According to the Jest's github, it's due to a recent bug with Node v11.11.

for those facing this issue: this happened after Node v11.11. the quickest fix is to downgrade Node to 11.10.1 in your CI lock file until further investigation

https://github.com/facebook/jest/issues/8069#issuecomment-470307590

had the same issue, solved when updating node to v11.12.0

Has the same issue: it did appear with image: node:latest in gitlab.yml.
Switching to node:10.15.3 has fixed the issue.

since it works with node 11.12, I'll close it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mayefeng picture mayefeng  路  44Comments

italomaia picture italomaia  路  88Comments

joeirimpan picture joeirimpan  路  35Comments

wuyuweixin picture wuyuweixin  路  35Comments

yyx990803 picture yyx990803  路  80Comments