The following works perfectly:
export default function x () {
return 'hello world'
}
export function y () {
return x()
}
console.log(y())
However this does not work:
export default async function x () {
return 'hello world'
}
export function y () {
return x()
.then(console.log)
}
y()
When the default
function is async
for some reason x is not defined
.