首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >mongodb缝合函数在使用node modeule @jimp时出错

mongodb缝合函数在使用node modeule @jimp时出错
EN

Stack Overflow用户
提问于 2020-04-29 22:55:26
回答 1查看 58关注 0票数 0

我在数据库触发器上使用mongodb缝合函数,以便使用node js jimp模块https://www.npmjs.com/package/jimp从URL读取图像。

我已经上传了jimp作为外部依赖来缝合函数。下面是我在函数中使用的代码

代码语言:javascript
运行
复制
const jimp = require('jimp');
const imageUrl = "https://images.unsplash.com/photo-1537454959372-885b35677ef5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1050&q=80";
let image2 = await jimp.read(imageUrl);  

执行函数时出现以下错误

代码语言:javascript
运行
复制
Error:
failed to execute source for 'jimp': failed to execute source for 'node_modules/jimp/dist/@jimp/custom': failed to execute source for 'node_modules/@jimp/custom/dist/@jimp/core': failed to execute source for 'node_modules/@jimp/core/dist/utils/mime': failed to execute source for 'node_modules/@jimp/core/dist/utils/core-js/modules/es.array.includes': TypeError
    at defineProperty (<native code>)
    at <anonymous>:6:12670
    at defineProperty (node_modules/core-js/internals/typed-array-constructor.js:87:11)
    at node_modules/core-js/internals/create-non-enumerable-property.js:12:10
    at node_modules/core-js/internals/redefine.js:34:35
    at node_modules/core-js/internals/export.js:60:5
    at node_modules/core-js/modules/es.array.includes.js:16:1
    at node_modules/@jimp/core/dist/utils/mime.js:9:1
    at node_modules/@jimp/core/dist/index.js:160:36
    at node_modules/@jimp/custom/dist/index.js:44:37
    at node_modules/jimp/dist/index.js:14:38 
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-05-24 09:43:49

看起来jimp正在使用Array.prototype.includes

目前缝合功能暂不支持

代码语言:javascript
运行
复制
Functions currently do not support the following ES6+ features:

 - New Global Object Types (i.e. WeakMap, Set, WeakSet, Symbol, Proxy)
 - New Math, Number, String, Array, and Object APIs (e.g.   
   Array.prototype.includes)

参考:https://docs.mongodb.com/stitch/functions/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61504832

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档