-
-
Notifications
You must be signed in to change notification settings - Fork 30
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/await examples in docs don’t run #219
Comments
This issue is fixed, for some reason Gitbook was building the old documentation source files. |
After installing Clio 0.8.2 , creating a new project and copying the code from the async/await example in a project, I still get the same error in Windows 10: D:\Clio\own_projects\async1>clio run
(node:10332) UnhandledPromiseRejectionWarning: ReferenceError: fetch is not defined All async/await programs: On Playground give the error: |
I forgot the fact that |
Describe the bug
All examples in async/await have either runtime or compilation issues:
Example 1: Windows 10:
error:
(node:8404) UnhandledPromiseRejectionWarning: ReferenceError: fetch is not defined
at D:\Clio\own_projects\await1\build\main.clio.js:1:187
-- at run (D:\Clio\own_projects\await\build\node\node_modules\clio-run\src\index.js:106:26)
-- at async D:\Clio\own_projects\await\build\node\node_modules\clio-run\src\runners\wt.js:32:5
-- (Use
node --trace-warnings ...
to show where the warning was created)-- (node:1056) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by
-- throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)-- (node:1056) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
-- <-- This process hangs
-- Output should be:
-- {"organization_name":"Telenet BVBA","region":"Flanders","accuracy":5,"asn":6848,"organization":"AS6848 Telenet BVBA","timezone":"Europe/Brussels","longitude":"4.4487","country_code3":"BEL","area_code":"0","ip":"81.83.67.231","city":"Mortsel","country":"Belgium","continent_code":"EU","country_code":"BE","latitude":"51.1662"}
[TypeError: Failed to fetch] ← probably same error
Example 2: await outside of flow
Example 3: await block:
Expecting one of lineBreak, conditional, fullConditional, function, symbol, parameter, number, array, string, formattedString, hashmap, propertyAccess, range, rangeFull, rangeBy, byRange, ranger, slice, set, wrapped, awaited, parallelFn, null, true, false, inCheck, group, assignment, arrowAssignment, math, comparison, logical, logicalNot, call, imported, outdent but encountered colon
Example 4: await [] same error as Example 3
Example 5: await keyword: same error as Example 3
To Reproduce
Steps to reproduce the behavior:
Expected behavior
json outputs of the fetch commands
Screenshots
If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
Possible solutions
If fix is not evident, either remove the section (temporarily) or write a header:
** WIP: In the current version 0.8.1 these code examples don't work **
Additional context
It was mention on Telegram that it would be fixed in v0.8, but it isn't
The text was updated successfully, but these errors were encountered: