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

lodash@4.17.15 报错 #994

Closed
SLYLXDYMJ opened this issue Nov 15, 2019 · 3 comments
Closed

lodash@4.17.15 报错 #994

SLYLXDYMJ opened this issue Nov 15, 2019 · 3 comments

Comments

@SLYLXDYMJ
Copy link

问题描述
使用 lodash@4.17.15 时,打包后的微信小程序报错,无法正常运行
注:dev 模式不报错,降级使用 lodash@4.16.0 也不报错,正常运行

复现步骤
在项目中引入 lodash@4.17.15

预期结果
正常运行

实际结果
TIM截图20191115100632

系统信息:
微信小程序

补充信息
根据 error 追踪到了 floor 方法
TIM截图20191115100731

@Wangyaqi
Copy link
Contributor

把项目精简一下发上来,我们测试一下

@SLYLXDYMJ
Copy link
Author

使用了 vue-cli 生成脚手架(默认模板)
在 page/index/index.vue
引入 lodash 并使用其 floor 方法(其余未更改)

  // lodash@4.17.15
  import _ from 'lodash'

  export default {
    data () {
      return {
        title: 'Hello',
        num: null
      }
    },
    onLoad () {
      this.num = _.floor(102.548741245, 2)
    },
    methods: {}
  }

打包后报以下错误

TIM截图20191119093333

@SLYLXDYMJ
Copy link
Author

@Wangyaqi

fxy060608 added a commit that referenced this issue Nov 21, 2019
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

No branches or pull requests

3 participants