-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async functions are not supported in library? #611
Comments
Maybe something changed in Expo SDK 51 For now, change const path = require('path');
const pak = require('../package.json');
module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
[
'module-resolver',
{
extensions: ['.tsx', '.ts', '.js', '.json'],
alias: {
// For development, we want to alias the library to the source
[pak.name]: path.join(__dirname, '..', pak.source),
},
},
],
],
};
}; |
I have the same issue, any |
@satya164 but async functions work inside the app. Only asyc functions inside the module doesnt work so i am not sure that is on expo's side or is it? |
@itsramiel By default the code is compiled with babel. in the template we use a different preset for the library code (to prepare for no-compilation step for published libs in the future) which is not compiling the Looks like async functions aren't fully supported yet. So we'd need to tweak our babel config in the template. Note that it doesn't affect your published library, only the example app usage. The above babel preset should work for you while we update our config. |
Description
I am trying to build a library and I am using async function like this for example:
but when I try to use async functions, I get the following error:
Packages
Selected options
js library
Link to repro
https://github.com/itsramiel/awesome-library
Environment
The text was updated successfully, but these errors were encountered: