#create-app failing on @swc/core build

19 messages · Page 1 of 1 (latest)

wide dew
#

I'm trying to use npx @backstage/create-app@latest and create a fresh install of Backstage to do some testing. During yarn install I'm running into an error when it builds @swc/core. I've followed instructions in the docs that calls out what to do if it fails on this step, however I still run into this same error. Has anyone else seen this error?

https://backstage.io/docs/getting-started/#general-folder-structure

YN0009: │ @swc/core@npm:1.13.20 [f3b21] couldn't be built successfully (exit code 129, logs can be found here: /private/var/folders/yv/6702jkwn7q79n4_s401pk3xm0000gn/T/xfs-bbd5f7fe/build.log)

The yarn log:

➜  Dev_Projects cat /private/var/folders/yv/6702jkwn7q79n4_s401pk3xm0000gn/T/xfs-261d2b9e/build.log
# This file contains the result of Yarn building a package (@swc/core@virtual:f3b21047a382a071e29ad1666f1bfda196eb23b36d5e1812ffefea6453b5cf43a2bf2055e74c360fec1f96a1636100d81f3465d2488515c89573c43112979d9b#npm:1.13.20)
# Script name: postinstall

rain sky
devout perch
devout perch
wide dew
devout perch
wide dew
# devout perch Yes the root package.json AFTER scaffolding the backstage app. Let it fail like ...

It built that time, 1.13.20 is still listed as a dependency and failing. It seems listed for the cli as "@swc/core": "npm:^1.3.46" which resolved to version 1.13.20.

➤ YN0000: ┌ Fetch step
➤ YN0013: │ 2 packages were added to the project (+ 38.93 MiB).
➤ YN0000: └ Completed in 2s 397ms
➤ YN0000: ┌ Link step
➤ YN0007: │ @swc/core@npm:1.13.20 [f3b21] must be built because it never has been before or the last one failed
➤ YN0007: │ @swc/core@npm:1.11.31 [36a01] must be built because it never has been before or the last one failed
➤ YN0009: │ @swc/core@npm:1.13.20 [f3b21] couldn't be built successfully (exit code 129, logs can be found here: /private/var/folders/yv/6702jkwn7q79n4_s401pk3xm0000gn/T/xfs-a4138962/build.log)
➤ YN0000: └ Completed in 2s 846ms
➤ YN0000: · Failed with errors in 6s 547ms
"@backstage/cli@npm:^0.34.2":
  version: 0.34.3
  resolution: "@backstage/cli@npm:0.34.3"
  dependencies:
    ...
    "@swc/core": "npm:^1.3.46"
"@swc/core@npm:^1.3.46":
  version: 1.13.20
  resolution: "@swc/core@npm:1.13.20"
devout perch
#

Run yarn tsc —immutable

And see what happens

#

I would still try to update the package to that 1.11 version for now. And if you need that 1.13 then you do a controlled upgrade

wide dew
#

yarn install --immutable output:

➤ YN0000: · Yarn 4.4.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0s 453ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ @testing-library/react is listed by your project with version 14.3.1 (pc9eb9), which doesn't satisfy what @backstage/test-utils requests (^16.0.0).
➤ YN0060: │ react is listed by your project with version 18.3.1 (pd98da), which doesn't satisfy what @material-ui/core and other dependencies request (but they have non-overlapping ranges!).
➤ YN0060: │ react-dom is listed by your project with version 18.3.1 (pfa800), which doesn't satisfy what @material-ui/core and other dependencies request (but they have non-overlapping ranges!).
➤ YN0002: │ app@workspace:packages/app doesn't provide @types/react (pceee1), requested by @backstage/app-defaults and other dependencies.
➤ YN0002: │ app@workspace:packages/app doesn't provide webpack (p299d9), requested by @backstage/cli.
➤ YN0002: │ backend@workspace:packages/backend doesn't provide webpack (p00f29), requested by @backstage/cli.
➤ YN0002: │ root@workspace:. doesn't provide webpack (p40c38), requested by @backstage/cli.
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code.
➤ YN0086: │ Some peer dependencies are incorrectly met by dependencies; run yarn explain peer-requirements for details.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 1s 639ms
➤ YN0000: ┌ Link step
➤ YN0007: │ @swc/core@npm:1.13.20 [f3b21] must be built because it never has been before or the last one failed
➤ YN0009: │ @swc/core@npm:1.13.20 [f3b21] couldn't be built successfully (exit code 129, logs can be found here: /private/var/folders/yv/6702jkwn7q79n4_s401pk3xm0000gn/T/xfs-5bc342db/build.log)
➤ YN0000: └ Completed in 1s 335ms
➤ YN0000: · Failed with errors in 3s 863ms```
#

I've added the dependency to my package.json:

#
    "@swc/core": "1.11.31"
  },```
rain sky
#

You’d use a resolution in your root package.json to pin it to a specific version.

wooden zinc
#

Hey now! I'm a backstage newbie so go easy on me -- but it's kind of a bummer that getting started instructions is br0ken due to this issue. Could we pin this version in the backstage codebase until swc-core fixes the issue? This fixes it for me: ```diff --git a/backstage/package.json b/backstage/package.json
index 6af00ca..9e426ed 100644
--- a/backstage/package.json
+++ b/backstage/package.json
@@ -38,7 +38,8 @@
},
"resolutions": {
"@types/react": "^18",

  • "@types/react-dom": "^18"
  • "@types/react-dom": "^18",
  • "@swc/core": "1.11.31"
    },
    "prettier": "@backstage/cli/config/prettier",
    "lint-staged": {```
wooden zinc
#

Follow UP: This failure only occured when I was running yarn from a docker ontainer. Once I installed Node/YArn locally it all worked fine

toxic glen
#

Does 1.13.19 work?

#

I'm just putting in a lock seed for this, which means that new create-apps will use that locked version without shipping a release.

#

But want to know the latest version which works, as locking too old could introduce other bugs