Skip to content

Commit

Permalink
downgrade swc/core because of TypeStrong/ts-node#2056
Browse files Browse the repository at this point in the history
This is the error that was happening:
```
/Users/me/Projects/Storybook/core/scripts/node_modules/ts-node/src/transpilers/swc.ts:262
      throw new Error(
            ^
Error: @swc/core threw an error when attempting to validate swc compiler options.
You may be using an old version of swc which does not support the options used by ts-node.
Try upgrading to the latest version of swc.
Error message from swc:
Failed to deserialize buffer as swc::config::Options
JSON: {"sourceMaps":true,"module":{"noInterop":false,"type":"commonjs","strictMode":true,"ignoreDynamic":false},"swcrc":false,"jsc":{"parser":{"syntax":"typescript","tsx":false,"dynamicImport":true,"importAssertions":true},"target":"es2020","transform":{"legacyDecorator":true,"react":{"throwIfNamespace":false,"useBuiltins":false}},"keepClassNames":true,"experimental":{"keepImportAssertions":true}}}

Caused by:
    unknown field `keepImportAssertions`, expected one of `plugins`, `keepImportAttributes`, `emitAssertForImportAttributes`, `cacheRoot`, `disableBuiltinTransformsForInternalTesting` at line 1 column 395
    at createVariant (/Users/me/Projects/Storybook/core/scripts/node_modules/ts-node/src/transpilers/swc.ts:262:13)
    at createSwcOptions (/Users/me/Projects/Storybook/core/scripts/node_modules/ts-node/src/transpilers/swc.ts:211:25)
    at create (/Users/me/Projects/Storybook/core/scripts/node_modules/ts-node/src/transpilers/swc.ts:56:41)
    at createTranspiler (/Users/me/Projects/Storybook/core/scripts/node_modules/ts-node/src/index.ts:784:16)
    at createTranspileOnlyGetOutputFunction (/Users/me/Projects/Storybook/core/scripts/node_modules/ts-node/src/index.ts:1341:28)
    at createFromPreloadedConfig (/Users/me/Projects/Storybook/core/scripts/node_modules/ts-node/src/index.ts:1404:34)
    at phase4 (/Users/me/Projects/Storybook/core/scripts/node_modules/ts-node/src/bin.ts:543:44)
    at bootstrap (/Users/me/Projects/Storybook/core/scripts/node_modules/ts-node/src/bin.ts:95:10)
    at main (/Users/me/Projects/Storybook/core/scripts/node_modules/ts-node/src/bin.ts:55:10)
    at Object.<anonymous> (/Users/me/Projects/Storybook/core/scripts/node_modules/ts-node/src/bin.ts:800:3)
```
  • Loading branch information
ndelangen committed Sep 12, 2023
1 parent 966aa79 commit 6235cab
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 51 deletions.
2 changes: 1 addition & 1 deletion code/builders/builder-webpack5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@storybook/node-logger": "workspace:*",
"@storybook/preview": "workspace:*",
"@storybook/preview-api": "workspace:*",
"@swc/core": "^1.3.49",
"@swc/core": "^1.3.82",
"@types/node": "^16.0.0",
"@types/semver": "^7.3.4",
"babel-loader": "^9.0.0",
Expand Down
2 changes: 1 addition & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
"@storybook/web-components": "workspace:*",
"@storybook/web-components-vite": "workspace:*",
"@storybook/web-components-webpack5": "workspace:*",
"@swc/core": "^1.3.23",
"@swc/core": "1.3.82",
"@swc/jest": "^0.2.26",
"@testing-library/dom": "^7.29.4",
"@testing-library/jest-dom": "^5.11.9",
Expand Down
121 changes: 118 additions & 3 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6579,7 +6579,7 @@ __metadata:
"@storybook/node-logger": "workspace:*"
"@storybook/preview": "workspace:*"
"@storybook/preview-api": "workspace:*"
"@swc/core": ^1.3.49
"@swc/core": ^1.3.82
"@types/node": ^16.0.0
"@types/pretty-hrtime": ^1.0.0
"@types/semver": ^7.3.4
Expand Down Expand Up @@ -7926,7 +7926,7 @@ __metadata:
"@storybook/web-components": "workspace:*"
"@storybook/web-components-vite": "workspace:*"
"@storybook/web-components-webpack5": "workspace:*"
"@swc/core": ^1.3.23
"@swc/core": 1.3.82
"@swc/jest": ^0.2.26
"@testing-library/dom": ^7.29.4
"@testing-library/jest-dom": ^5.11.9
Expand Down Expand Up @@ -8502,77 +8502,192 @@ __metadata:
languageName: node
linkType: hard

"@swc/core-darwin-arm64@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-darwin-arm64@npm:1.3.82"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@swc/core-darwin-arm64@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-darwin-arm64@npm:1.3.84"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@swc/core-darwin-x64@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-darwin-x64@npm:1.3.82"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@swc/core-darwin-x64@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-darwin-x64@npm:1.3.84"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@swc/core-linux-arm-gnueabihf@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.82"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard

"@swc/core-linux-arm-gnueabihf@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.84"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard

"@swc/core-linux-arm64-gnu@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-linux-arm64-gnu@npm:1.3.82"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-arm64-gnu@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-linux-arm64-gnu@npm:1.3.84"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-arm64-musl@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-linux-arm64-musl@npm:1.3.82"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard

"@swc/core-linux-arm64-musl@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-linux-arm64-musl@npm:1.3.84"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard

"@swc/core-linux-x64-gnu@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-linux-x64-gnu@npm:1.3.82"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-x64-gnu@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-linux-x64-gnu@npm:1.3.84"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-x64-musl@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-linux-x64-musl@npm:1.3.82"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard

"@swc/core-linux-x64-musl@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-linux-x64-musl@npm:1.3.84"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard

"@swc/core-win32-arm64-msvc@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-win32-arm64-msvc@npm:1.3.82"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@swc/core-win32-arm64-msvc@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-win32-arm64-msvc@npm:1.3.84"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@swc/core-win32-ia32-msvc@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-win32-ia32-msvc@npm:1.3.82"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard

"@swc/core-win32-ia32-msvc@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-win32-ia32-msvc@npm:1.3.84"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard

"@swc/core-win32-x64-msvc@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-win32-x64-msvc@npm:1.3.82"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@swc/core-win32-x64-msvc@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-win32-x64-msvc@npm:1.3.84"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@swc/core@npm:^1.3.23, @swc/core@npm:^1.3.49":
"@swc/core@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core@npm:1.3.82"
dependencies:
"@swc/core-darwin-arm64": 1.3.82
"@swc/core-darwin-x64": 1.3.82
"@swc/core-linux-arm-gnueabihf": 1.3.82
"@swc/core-linux-arm64-gnu": 1.3.82
"@swc/core-linux-arm64-musl": 1.3.82
"@swc/core-linux-x64-gnu": 1.3.82
"@swc/core-linux-x64-musl": 1.3.82
"@swc/core-win32-arm64-msvc": 1.3.82
"@swc/core-win32-ia32-msvc": 1.3.82
"@swc/core-win32-x64-msvc": 1.3.82
"@swc/types": ^0.1.4
peerDependencies:
"@swc/helpers": ^0.5.0
dependenciesMeta:
"@swc/core-darwin-arm64":
optional: true
"@swc/core-darwin-x64":
optional: true
"@swc/core-linux-arm-gnueabihf":
optional: true
"@swc/core-linux-arm64-gnu":
optional: true
"@swc/core-linux-arm64-musl":
optional: true
"@swc/core-linux-x64-gnu":
optional: true
"@swc/core-linux-x64-musl":
optional: true
"@swc/core-win32-arm64-msvc":
optional: true
"@swc/core-win32-ia32-msvc":
optional: true
"@swc/core-win32-x64-msvc":
optional: true
peerDependenciesMeta:
"@swc/helpers":
optional: true
checksum: cee1f56e969074fe9e23fe51348d7da0c921949f5845e57030824d0e32d09fcefc647371c982e82836cc72c27c5fc5370c6aaff4f8f1c527d1c39c5ab6203e17
languageName: node
linkType: hard

"@swc/core@npm:^1.3.82":
version: 1.3.84
resolution: "@swc/core@npm:1.3.84"
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@storybook/jest": "next",
"@storybook/linter-config": "^3.1.2",
"@storybook/testing-library": "next",
"@swc/core": "^1.3.23",
"@swc/core": "1.3.82",
"@testing-library/dom": "^9.3.0",
"@testing-library/jest-dom": "^5.11.9",
"@testing-library/react": "^14.0.0",
Expand Down
90 changes: 45 additions & 45 deletions scripts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2911,7 +2911,7 @@ __metadata:
"@storybook/jest": next
"@storybook/linter-config": ^3.1.2
"@storybook/testing-library": next
"@swc/core": ^1.3.23
"@swc/core": 1.3.82
"@testing-library/dom": ^9.3.0
"@testing-library/jest-dom": ^5.11.9
"@testing-library/react": ^14.0.0
Expand Down Expand Up @@ -3058,90 +3058,90 @@ __metadata:
languageName: node
linkType: hard

"@swc/core-darwin-arm64@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-darwin-arm64@npm:1.3.84"
"@swc/core-darwin-arm64@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-darwin-arm64@npm:1.3.82"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@swc/core-darwin-x64@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-darwin-x64@npm:1.3.84"
"@swc/core-darwin-x64@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-darwin-x64@npm:1.3.82"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@swc/core-linux-arm-gnueabihf@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.84"
"@swc/core-linux-arm-gnueabihf@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.82"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard

"@swc/core-linux-arm64-gnu@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-linux-arm64-gnu@npm:1.3.84"
"@swc/core-linux-arm64-gnu@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-linux-arm64-gnu@npm:1.3.82"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-arm64-musl@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-linux-arm64-musl@npm:1.3.84"
"@swc/core-linux-arm64-musl@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-linux-arm64-musl@npm:1.3.82"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard

"@swc/core-linux-x64-gnu@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-linux-x64-gnu@npm:1.3.84"
"@swc/core-linux-x64-gnu@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-linux-x64-gnu@npm:1.3.82"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@swc/core-linux-x64-musl@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-linux-x64-musl@npm:1.3.84"
"@swc/core-linux-x64-musl@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-linux-x64-musl@npm:1.3.82"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard

"@swc/core-win32-arm64-msvc@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-win32-arm64-msvc@npm:1.3.84"
"@swc/core-win32-arm64-msvc@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-win32-arm64-msvc@npm:1.3.82"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@swc/core-win32-ia32-msvc@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-win32-ia32-msvc@npm:1.3.84"
"@swc/core-win32-ia32-msvc@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-win32-ia32-msvc@npm:1.3.82"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard

"@swc/core-win32-x64-msvc@npm:1.3.84":
version: 1.3.84
resolution: "@swc/core-win32-x64-msvc@npm:1.3.84"
"@swc/core-win32-x64-msvc@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core-win32-x64-msvc@npm:1.3.82"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@swc/core@npm:^1.3.23":
version: 1.3.84
resolution: "@swc/core@npm:1.3.84"
"@swc/core@npm:1.3.82":
version: 1.3.82
resolution: "@swc/core@npm:1.3.82"
dependencies:
"@swc/core-darwin-arm64": 1.3.84
"@swc/core-darwin-x64": 1.3.84
"@swc/core-linux-arm-gnueabihf": 1.3.84
"@swc/core-linux-arm64-gnu": 1.3.84
"@swc/core-linux-arm64-musl": 1.3.84
"@swc/core-linux-x64-gnu": 1.3.84
"@swc/core-linux-x64-musl": 1.3.84
"@swc/core-win32-arm64-msvc": 1.3.84
"@swc/core-win32-ia32-msvc": 1.3.84
"@swc/core-win32-x64-msvc": 1.3.84
"@swc/core-darwin-arm64": 1.3.82
"@swc/core-darwin-x64": 1.3.82
"@swc/core-linux-arm-gnueabihf": 1.3.82
"@swc/core-linux-arm64-gnu": 1.3.82
"@swc/core-linux-arm64-musl": 1.3.82
"@swc/core-linux-x64-gnu": 1.3.82
"@swc/core-linux-x64-musl": 1.3.82
"@swc/core-win32-arm64-msvc": 1.3.82
"@swc/core-win32-ia32-msvc": 1.3.82
"@swc/core-win32-x64-msvc": 1.3.82
"@swc/types": ^0.1.4
peerDependencies:
"@swc/helpers": ^0.5.0
Expand Down Expand Up @@ -3169,7 +3169,7 @@ __metadata:
peerDependenciesMeta:
"@swc/helpers":
optional: true
checksum: 9b321aa779294134685507d61923d29e9248da58bb1af94168c220e25b54767c6ecc809ab815b3a3098bab63be26eea5cc86502bdd02930da1ded3cf35b516a8
checksum: cee1f56e969074fe9e23fe51348d7da0c921949f5845e57030824d0e32d09fcefc647371c982e82836cc72c27c5fc5370c6aaff4f8f1c527d1c39c5ab6203e17
languageName: node
linkType: hard

Expand Down

0 comments on commit 6235cab

Please sign in to comment.