Closed sdack-cloud closed 8 months ago
Using uni app
vue create -p dcloudio/uni-preset-vue uni-type-demo
Hey sdack-cloud,
The tinify-nodejs client is not build or meant to be run in a frontend app. The fs.ReadFileSync is not available in a browser context, but is used in the tinify code.
In case you use a frontend framework with API views, use the tinify client only in the server code.
The problem with running Tinify in frontend code, is that your API key will be leaked in the user browser., therefore using the API directly in a browser context is not made possible.
ERROR
Reason: TypeError: fs.readFileSync is not a function
nodejs v15.14.0 npm 7.7.6 "tinify": "^1.7.1", "vue": "^2.6.11", "typescript": "~4.1.5",