Comments (3)
Hi there! While we wait for this particular issue to be solved. What should we do in the meantime to get async/await working?
having the --web-component flag still produces the same problem.
installing babel-polyfill on my project does not solve the problem.
adding a babel section with includePolyfill: true in ember-cli-build.js does not solve the problem.
Any combination of the above does not seem to work.
from glimmer-application.
As a quick work around, I switched the target in the .tsconfig to es5:
{
"compilerOptions": {
- "target": "es6",
+ "target": "es5",
"module": "es2015",
"inlineSourceMap": true,
"inlineSources": true,
If the browsers you are targeting already have promises, then that should do the trick.
Typescript will warn that you'll need to explicitly include promises (since es5 didn't have them):
An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option.
That should be something like this:
{
"compilerOptions": {
- "target": "es6",
+ "target": "es5",
"module": "es2015",
"inlineSourceMap": true,
"inlineSources": true,
"moduleResolution": "node",
- "experimentalDecorators": true
+ "experimentalDecorators": true,
+ "lib": [
+ "es2015"
+ ]
},
However, looks like we can't manually specify extra libs in the tsconfig file with broccoli yet and adding the lib property causes the build to fail (tildeio/broccoli-typescript-compiler#35):
The Broccoli Plugin: [broccoli-typescript-compiler] failed with:
TypeError: Cannot read property 'length' of undefined
So, don't add the lib property and just ignore the typescript warning.
Overall, not ideal, but it at least got me started.
from glimmer-application.
Instructions now at https://github.com/glimmerjs/glimmer-application-pipeline#enabling-use-of-async-await-in-components.
from glimmer-application.
Related Issues (20)
- Documentation for running multiple apps on the same page HOT 1
- Helper runs every few milliseconds after a tracked property changes HOT 1
- Things That Need To Be Fixed HOT 3
- Sourcemaps seem to have issues HOT 4
- Document (and improve) using npm packages HOT 3
- Ergonomics / Polish / Initial Experience "Punch List" HOT 2
- Accessing ENV HOT 1
- Advanced helpers HOT 1
- `renderComponent` doesn't accept args or attributes HOT 3
- userland files HOT 1
- ember-cli-deploy doesn't work with latest glimmer-application HOT 1
- Argument and property naming conflict HOT 7
- Docs lacking: how do I use Glimmer as a view layer for my app? HOT 1
- Nested components don't appear to work as documented HOT 2
- Tracked property on a service doesn't invalidate tag HOT 1
- `@tracked('args')` in component nested within a `{{#each}}` seem to invalidate with old values HOT 2
- `renderComponent` options API proposal HOT 3
- Return value of an action argument to a component always seems to be undefined for me
- Running `ember test` on a Glimmer App breaks if run on BashOnWindows HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glimmer-application.