Skip to content

Commit

Permalink
fix: Fix cleanup logic in validation for ssr
Browse files Browse the repository at this point in the history
  • Loading branch information
tjtanjin committed Oct 1, 2024
1 parent 265955c commit 30e44c3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ssr/ssr-validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ try {
ReactDOMServer.renderToString(React.createElement(ChatBot));
console.info('ChatBot: server-side rendering validation passed.');
} catch (error) {
//fs.rmSync(noCssImportFilePath);
fs.rmSync(noCssImportFilePath);
console.error('ChatBot rendered server-side with error.', error);
throw new Error('ChatBot: server-side rendering validation failed.');
} finally {
fs.rmSync(noCssImportFilePath);
}

// SSR Validation: ChatBotProvider
Expand All @@ -44,11 +42,9 @@ try {
ReactDOMServer.renderToString(React.createElement(ChatBotProvider));
console.info('ChatBotProvider: server-side rendering validation passed.');
} catch (error) {
//fs.rmSync(noCssImportFilePath);
fs.rmSync(noCssImportFilePath);
console.error('ChatBotProvider rendered server-side with error.', error);
throw new Error('ChatBotProvider: server-side rendering validation failed.');
} finally {
fs.rmSync(noCssImportFilePath);
}

fs.rmSync(noCssImportFilePath);

0 comments on commit 30e44c3

Please sign in to comment.