How could I use async/await in browser with babel6?
See original GitHub issuebabel-core 6.1.21 babel-loader 6.2.0
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
plugins: ['transform-runtime'],
presets: ['es2015', 'stage-0', 'stage-3']
}
}]
}
have an error:
Uncaught TypeError: (0 , _typeof3.default) is not a function
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
A guide to through async/await with Babel and Webpack
At first, the JavaScript projects with Webpack ran well. Then I realized that our project should be able to run on an outdated...
Read more >babel 6 async / await: Unexpected token - Stack Overflow
Just using babel with stage-0 and es2015 preset works for me as long as you import babel-polyfill in your entry point. As BrunoLM...
Read more >babel/plugin-transform-async-to-generator
Turn async functions into a Bluebird coroutine (caveats) ... When using await with non-promise values, Bluebird will throw "Error: A value was yielded...
Read more >Add ES7 Async/Await Support for your Webapp in 3 Easy Steps
Step by step guide to add async/await in your build flow.
Read more >Async await with ES6/Babel and TypeScript - Temple Coding
Using it today with Babel and Webpack ... Async functions are still a proposal for future versions of JavaScript, but it can already...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@liam4 @jtHwong hi guys, in order to use async/await functions with webpack and babel you need to add a babel polyfill in your entry on webpack config, this work on both, nodejs and browser, take a look:
this is how is working for me.
solution
https://esausilva.com/2017/07/11/uncaught-referenceerror-regeneratorruntime-is-not-defined-two-solutions/
https://babeljs.io/docs/usage/polyfill/
https://babeljs.io/docs/plugins/transform-regenerator/
OK