ECONNRESET
See original GitHub issueI’m getting UnhandledPromiseRejectionWarning: Error: read ECONNRESET
,
Is there a debug mode so I can understand what’s happening here?
my config file:
module.exports = {
commands: [
[
"components",
{
fileId: "XXXX",
onlyFromPages: ["icons", "illustrations"],
transformers: [
require("@figma-export/transform-svg-with-svgo")({
plugins: [{ removeViewBox: false }, { removeDimensions: true }],
}),
],
outputters: [
async (pages) => {
const output = "./public";
fs.mkdirSync(output, { recursive: true });
console.log("OUTPUT", output);
try {
pages.forEach(({ name: pageName, components }) => {
console.log("PAGE", pageName);
components.forEach(({ name: componentName, svg }) => {
const filePath = path.resolve(output, `${componentName}.svg`);
let p = filePath.split("/");
p.pop();
p = p.join("/");
fs.mkdirSync(p, { recursive: true });
fs.writeFileSync(filePath, svg);
console.log("GENERATED", filePath, componentName);
});
});
} catch (e) {
console.log(e);
}
},
],
},
],
],
};
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
How do I debug error ECONNRESET in Node.js?
ECONNRESET occurs when the server side closes the TCP connection and your request to the server is not fulfilled. The server ...
Read more >What does “Error: read ECONNRESET” mean?
You might have guessed it already: it's a connection error. "ECONNRESET" means the other side of the TCP conversation abruptly closed its end...
Read more >Fixing an ECONNRESET error
The ECONRESET error means that the server unexpectedly closed the connection and the request to the server was not fulfilled. Connection-related ...
Read more >Return code ECONNRESET for TCP/IP
Depending upon the platform or platforms your enterprise uses, you receive the following return code when the connection is reset by peer (ECONNRESET):....
Read more >read ECONNRESET when trying a simple GET request ...
Error: read ECONNRESET is a problem in Node.js. There seesm to be something wrong yout TCP connection setup. Can you share a code...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @berkaey, thank you for all these details.
I tried by using the same configuration you provided (off-course with a different Figma File) and everything worked properly. For sure I’ve to handle all promise rejection and improve the application log to better understand the root cause.
The error
ECONNRESET
should be not related to transformers since they just manipulate strings.ECONNRESET
is related to a network issue. Figma Export uses the network to connect to Figma Api and to download SVGs. I can also improve the application there to better handle exceptions from Figma.Rate Limit is for sure another option, I’ll investigate more.
Thanks, I’ll keep you posted.
yes I noticed that too, but I also replace some IDs in SVG file so this is why I implemented it like this.