aleph.js icon indicating copy to clipboard operation
aleph.js copied to clipboard

aleph build doesn't honor deno.json target

Open aricart opened this issue 3 years ago • 1 comments
trafficstars

Doing a build to try to bypass the CORS issue, seems to fail:

Looking up latest version...
Already up-to-date!
> aleph build
 > .aleph/production/lib/billingclient.bundling.js:3142:4: error: Transforming async generator functions to the configured target environment ("es2015") is not supported yet
    3142 │     async *iterate() {
         ╵     ~~~~~

 > .aleph/production/lib/billingclient.bundling.js:5260:24: error: Transforming for-await loops to the configured target environment ("es2015") is not supported yet
    5260 │                     for await (const b of this.transport){

The deno.json file is configured as

{
  "compilerOptions": {
    "allowJs": true,
    "target": "es2018",
    "lib": [
      "dom",
      "dom.iterable",
      "dom.asynciterable",
      "deno.ns",
      "deno.unstable"
    ],
    "jsx": "react"
  },
  "lint": {},
  "format": {}
}

I noticed that there's a recent unreleased fix towards this, so I attempted a build from master:

deno install -A --unstable --no-check --location http://localhost/ -n aleph -f https://raw.githubusercontent.com/alephjs/aleph.js/master/cli.ts

But the error is still present.

aricart avatar Dec 06 '21 21:12 aricart

After some digging through the source found:

aleph.config.json - it seems the target is honored there - really need some description there as to this file, better yet. Have init create it with the defaults. Then it is right out there!

aricart avatar Dec 07 '21 15:12 aricart