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

forEach not working with vue-cli typescript #4035

Closed
avxkim opened this issue May 21, 2019 · 2 comments · May be fixed by posrix/vue-cli#121
Closed

forEach not working with vue-cli typescript #4035

avxkim opened this issue May 21, 2019 · 2 comments · May be fixed by posrix/vue-cli#121

Comments

@avxkim
Copy link

avxkim commented May 21, 2019

Version

3.7.0

Environment info

  System:
    OS: macOS 10.14.5
    CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
  Binaries:
    Node: 12.1.0 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.9.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 74.0.3729.157
    Firefox: Not Found
    Safari: 12.1.1
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0-beta.3
    @vue/babel-plugin-transform-vue-jsx:  1.0.0-beta.3
    @vue/babel-preset-app:  3.7.0
    @vue/babel-preset-jsx:  1.0.0-beta.3
    @vue/babel-sugar-functional-vue:  1.0.0-beta.3
    @vue/babel-sugar-inject-h:  1.0.0-beta.3
    @vue/babel-sugar-v-model:  1.0.0-beta.3
    @vue/babel-sugar-v-on:  1.0.0-beta.3
    @vue/cli-overlay:  3.7.0
    @vue/cli-plugin-babel: ^3.7.0 => 3.7.0
    @vue/cli-plugin-typescript: ^3.7.0 => 3.7.0
    @vue/cli-plugin-unit-mocha: ^3.7.0 => 3.7.0
    @vue/cli-service: ^3.7.0 => 3.7.0
    @vue/cli-shared-utils:  3.7.0
    @vue/component-compiler-utils:  2.6.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
    bootstrap-vue: ^2.0.0-rc.19 => 2.0.0-rc.20
    portal-vue:  2.1.4
    typescript: ^3.4.5 => 3.4.5
    vue: ^2.6.10 => 2.6.10
    vue-class-component: ^7.1.0 => 7.1.0
    vue-element-loading: ^1.1.1 => 1.1.1
    vue-functional-data-merge:  2.0.7
    vue-hot-reload-api:  2.3.3
    vue-loader:  15.7.0
    vue-property-decorator: ^8.1.1 => 8.1.1
    vue-router: ^3.0.6 => 3.0.6
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.6.10 => 2.6.10
    vue-template-es2015-compiler:  1.9.1
    vuex: ^3.1.0 => 3.1.1
    vuex-module-decorators: ^0.9.8 => 0.9.9
    vuex-persist: ^2.0.0 => 2.0.0
  npmGlobalPackages:
    @vue/cli: 3.5.5

Steps to reproduce

const arr1 = [1, 2, 3, 4, 5]
const arr2 = []
arr1.forEach(element => {
  arr2.push({
    text: element.text,
    value: element.value
  })
})

What is expected?

It just works

What is actually happening?

Error happens:

This dependency was not found:

  • core-js/modules/web.dom.iterable

Seems like babel polyfills .forEach for no reason.

@haoqunjiang
Copy link
Member

You may have a wrong version of top-level core-js dependency hoisted. Please run npm install --save core-js@2 and try again.

@xgqfrms
Copy link

xgqfrms commented May 22, 2019

Q:

how to show Local PC / Mac Environment Info?

A:

just using the cli

$ vue info

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 a pull request may close this issue.

3 participants