-
Notifications
You must be signed in to change notification settings - Fork 26.6k
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 defined on module throw TypeError #202
Comments
Looks like this and #168 are duplicates |
@amccloud I think this is likely the root cause of both the problems with template literals and async functions (and no doubt other ES6 functionality that no-one has stumbled over yet). I'll test it against the template literals later, fingers crossed. |
It seems this is the problem of https://github.com/tleunen/babel-plugin-module-resolver This problem doesn't occur when you use Function expression or Arrow function as @sedubois reported in #168 |
Thank you @nkzawa for reporting the issue. I've fixed the issue and released a v2.3.0. Let me know if you have any other problems. |
Looks like the
babel-runtime
alias in the webpack config is causing babel to transpile incorrectly. Any async function defined on the module fails because_regenerator2
isundefined
. If the aysnc function is defined within a class, like withgetInitialProps
, everything works. Without the alias everything appears to work. I'm using[email protected]
.pages/index.js
throws:
with
babel-runtime
aliaswithout
babel-runtime
aliaspossibly related issues
The text was updated successfully, but these errors were encountered: