Skip to content

forEach not working with vue-cli typescript #4035

Closed
posrix/vue-cli
#121
@avxkim

Description

@avxkim

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions