<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yamekodev</author_name>
  <author_url>https://blog.hatena.ne.jp/yamekodev/</author_url>
  <blog_title>yamekodevの日記</blog_title>
  <blog_url>https://yamekodev.hatenadiary.org/</blog_url>
  <categories>
    <anon>Node.js</anon>
  </categories>
  <description>awaitが使えるのはasyncつけた関数の中。 じゃあ下記ケースではどこにasyncをつけるべきか？ hoge: function() { var self = this; return new Promise((resolve, reject) =&gt; { try { await _get(); ここ。await部分を含む、最も近い無名関数。 return new Promise(async(resolve, reject) =&gt; { エラー原因は、最初下記にasyncつけてたこと。 hoge: async function() {</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyamekodev.hatenadiary.org%2Fentry%2F2020%2F10%2F14%2F232259&quot; title=&quot; Node.js  SyntaxError: await is only valid in async function - yamekodevの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-10-14 23:22:59</published>
  <title> Node.js  SyntaxError: await is only valid in async function</title>
  <type>rich</type>
  <url>https://yamekodev.hatenadiary.org/entry/2020/10/14/232259</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
