【问题标题】:Astro transforming async generator functions is not supported yet尚不支持 Astro 转换异步生成器函数
【发布时间】:2023-02-10 23:17:33
【问题描述】:

我想为我的网站支持旧浏览器。我目前正在尝试使用@vitejs/plugin-legacy。但是在构建时我得到了这个错误,

[vite:esbuild-transpile] Transform failed with 9 errors:
entry.mjs:551:0: ERROR: Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
entry.mjs:683:2: ERROR: Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
entry.mjs:696:0: ERROR: Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
entry.mjs:1256:2: ERROR: Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
entry.mjs:1295:0: ERROR: Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
...

Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
548|  function markHTMLBytes(bytes) {
549|    return new HTMLBytes(bytes);
550|  }
   |    ^
551|  async function* unescapeChunksAsync(iterable) {
   |  ^
552|    for await (const chunk of iterable) {

Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
681|      return "AstroComponent";
682|    }
683|    async *[Symbol.asyncIterator]() {
   |    ^
684|      const { htmlParts, expressions } = this;
685|      for (let i = 0; i < htmlParts.length; i++) {

Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
693|  function isRenderTemplateResult(obj) {
694|    return typeof obj === "object" && !!obj[renderTemplateResultSym];
695|  }
   |    ^
696|  async function* renderAstroTemplateResult(component) {
   |  ^
697|    for await (const value of component) {

Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
1254|      return this.returnValue;
1255|    }
1256|    async *render() {
   |    ^
1257|      if (this.returnValue === void 0) {
1258|        await this.init();

Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
1292|    return typeof obj === "object" && !!obj[astroComponentInstanceSym];
1293|  }
1294|  
   |   ^
1295|  async function* renderChild(child) {
   |  ^
1296|    child = await child;

Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
1987|    }
1988|    if (!hydration) {
1989|      return async function* () {
   |             ^
1990|        if (slotInstructions) {
1991|          yield* slotInstructions;

Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
2029|      island.props["await-children"] = "";
2030|    }
2031|    async function* renderAll() {
   |    ^
2032|      if (slotInstructions) {
2033|        yield* slotInstructions;

Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
2086|    const children = item.children;
2087|    return index === all.findIndex((i) => JSON.stringify(i.props) === props && i.children == children);
2088|  };
   |     ^
2089|  async function* renderExtraHead(result, base) {
   |  ^
2090|    yield base;

Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
2111|    return renderAllHeadContent.bind(null, result);
2112|  }
2113|  const renderHead = createRenderHead;
   |                                       ^
2114|  async function* maybeRenderHead(result) {
   |  ^
2115|    if (result._metadata.hasRenderedHead) {

 error   Transforming async generator functions to the configured target environment ("chrome64", "edge79", "es2020", "firefox67", "safari11.1" + 2 overrides) is not supported yet
  File:
    entry.mjs

转载:https://stackblitz.com/edit/typescript-ry3189

我该如何解决?

【问题讨论】:

    标签: javascript html astro


    【解决方案1】:

    尝试再次运行“npm install”,然后运行“npm run build” 总觉得是因为初始化没有完成

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-17
      • 2017-10-22
      • 1970-01-01
      • 2020-11-20
      • 2018-11-24
      • 1970-01-01
      相关资源
      最近更新 更多