export function formatCurrency(amount: number, currencyCode: string): string {
let formattedAmount = amount.toFixed(2);
switch (currencyCode) {
case 'EUR':
return `€${formattedAmount}`;
case 'USD':
return `$${formattedAmount}`;
default:
return `${formattedAmount} ${currencyCode}`;
}
}
Tried to compile the app, and got the error "Error: don't know how to turn this value into a node". On digging a little deeper, I was able to trace the bug to this package. The package apparently tried to inline toFixed and failed.
Describe the bug
I wrote this sample code:
Tried to compile the app, and got the error "Error: don't know how to turn this value into a node". On digging a little deeper, I was able to trace the bug to this package. The package apparently tried to inline
toFixed
and failed.Configuration
How are you using babel-minify?
Used indirectly through
@storybook/core@5.1.9