backstage-plugin-toolbox icon indicating copy to clipboard operation
backstage-plugin-toolbox copied to clipboard

Backstage 1.27 Build fails with Toolbox 1.21.0

Open christianherweg0807 opened this issue 1 year ago • 21 comments

I Have started getting error: ERROR: Big integer literals are not available in the configured target environment ("es2019") while running yarn workspace backend build

For Details see: https://github.com/backstage/backstage/issues/24939

A downgrade to 1.20.5 helps.

regards Christian

christianherweg0807 avatar Jun 01 '24 14:06 christianherweg0807

@helltf any idea why this is happening? The latest release contained only the new tool for generating types.

drodil avatar Jun 01 '24 18:06 drodil

no clue, maybe the quicktype package is not compatible with es2019

helltf avatar Jun 01 '24 18:06 helltf

I could not replicate this problem, upgraded to backstage version 1.27.5 and installed version 1.21.0 of this plugin. No Error message, no problem, works as expected.

my tsconfig

{
  "extends": "@backstage/cli/config/tsconfig.json",
  "include": [
    "packages/*/src",
    "plugins/*/src",
    "plugins/*/dev",
    "plugins/*/migrations"
  ],
  "exclude": [
    "node_modules"
  ],
  "compilerOptions": {
    "jsx": "react",
    "outDir": "dist-types",
    "rootDir": ".",
    "resolveJsonModule": true,
  }
}

Tried with ES2020 as target, still no problem

helltf avatar Jun 03 '24 05:06 helltf

Confirm I'm seeing it too. This change https://github.com/backstage/backstage/pull/24776 should resolve it once released.

fshowalter avatar Jun 03 '24 14:06 fshowalter

@fshowalter thanks for confirming, probably have to live with this until the next backstage release on 18th of June. So my suggestion is to go with 1.20.5 until that.

drodil avatar Jun 04 '24 05:06 drodil

I'm still getting the same error with backstage v1.28.0 and @drodil/[email protected]. Downgrading to 1.20.5 fixes it of course but I was expecting the 1.28.0 release to fix it. Is there something else I need to reset/update/clean or are others also still getting this build error?

brianphillips avatar Jun 18 '24 21:06 brianphillips

Thanks for reporting, it's weird as the https://github.com/backstage/backstage/pull/24776 should have fixed that. I will take a look if I have time before my holiday (starting tomorrow) and if nothing else, we have to get rid of the breaking tool to continue getting new ones in.

drodil avatar Jun 19 '24 05:06 drodil

Ah, probably if I bump also the toolbox to use the latest backstage packages it could fix the issue.

drodil avatar Jun 19 '24 05:06 drodil

Next try with v1.22.1!

drodil avatar Jun 19 '24 05:06 drodil

Nope, didn't help. I don't know if the tsconfig.json should be changed somehow or if we should just get rid of the breaking tool, WDYT?

drodil avatar Jun 19 '24 06:06 drodil

I don't think it's a Typescript issue per se, but an esbuild one, as I think Backstage uses that versus Typescript compiler for the source transformation these days.

The frustrating thing is, I haven't found a way to debug it to see which file/line is tripping the error and/or where it's getting the 2019 config....

fshowalter avatar Jun 24 '24 11:06 fshowalter

Can confirm that I have the error with Backstage 1.28.4

dweber019 avatar Jul 06 '24 10:07 dweber019

After some debugging found out that setting this to es2020 in the backstage cli package https://github.com/backstage/backstage/blob/d73302be50d5dcc91ff6fc6da60355183abeb8f3/packages/cli/src/lib/bundler/optimization.ts#L31 the build no longer fails.

The error originates from the quicktype-core package

dariozachow avatar Jul 10 '24 07:07 dariozachow

How do you set this to es2020 in the backstage cli? I got same issue with backstage "1.29.1" and toolbox 1.22.1.

I don't really see the option in doc to set it. The latest code is here https://github.com/backstage/backstage/blob/b24d5b0aa4fba4a26db16d0d695e140b5da1f233/packages/cli/src/lib/bundler/optimization.ts#L37

michaelsync-bn avatar Jul 22 '24 12:07 michaelsync-bn

You can't really do this, I've edited the code directly in my node_modules

dariozachow avatar Jul 22 '24 13:07 dariozachow

How about proposing upstream change? I think @Rugvip changed already some of these to 2020?

drodil avatar Jul 22 '24 19:07 drodil

https://github.com/backstage/backstage/issues/25737 @drodil I've created this Issue for reference. Not sure if I have the time to propose a PR for this

dariozachow avatar Jul 23 '24 06:07 dariozachow

Made a PR to upstream, have to wait for the next release :(

drodil avatar Jul 23 '24 08:07 drodil

Can confirm that this is still an issue for Backstage 1.29 with a fresh install of both Backstage and the toolbox plugin: https://github.com/CptnFizzbin/backstage-toolbox-test/commit/03d20c78d1705f9aa589479152f91bf3cb638a4d

CptnFizzbin avatar Aug 07 '24 18:08 CptnFizzbin

@CptnFizzbin thanks, it's a known issue. Is anyone able to try with the latest -next release of backstage with https://github.com/backstage/backstage/pull/25738 included? Or does it actually require rebuilding this plugin 🤔 Maybe it's best to wait for the 1.30.0. For now 1.20.5 version of this plugin works.

drodil avatar Aug 08 '24 04:08 drodil

I can confirm that 1.22.1 builds fine with 1.30.0-next.3

CptnFizzbin avatar Aug 11 '24 17:08 CptnFizzbin

Should be fine now with 1.30.x+. Closing this issue!

drodil avatar Aug 23 '24 11:08 drodil