tinify-nodejs icon indicating copy to clipboard operation
tinify-nodejs copied to clipboard

在vue3+nuxt3中无法使用require("tinify");导入

Open SilenceYiChen opened this issue 2 years ago • 2 comments

在vue3+nuxt3中无法使用require("tinify");导入 问下是否支持在vue3中使用 node版本18.1.0 报错如下 QQ截图20230521134728

SilenceYiChen avatar May 21 '23 05:05 SilenceYiChen

It is possible to import Tinify as a ES6 module as follows;

import tinify from "tinify";

Could you give it a try?

In addition, make sure to not use the tinify library in a frontend application and only in the backend. the tinify client does not support frontend integration, and all interactions should be handled by your own API.

tinify-support avatar May 22 '23 07:05 tinify-support

你确定你要在编译阶段运行tinify来压缩和打开图片吗?
按上面官方的回复, 这个是给nodejs后端使用的, 如果你是web端,并且在runtime阶段, 限于浏览器客户端的限制,目前这个库的nodejs版是没有做客户端的支持的

Lukunlin avatar Aug 11 '24 10:08 Lukunlin