Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version "1.10.9" gives error "Failed to deserialize buffer as swc::config::Options" #829

Open
ab-geoff-plitt opened this issue Jul 17, 2024 · 1 comment

Comments

@ab-geoff-plitt
Copy link

With Node v20.15.1, "@swc-node/register" worked fine with v1.9.1, but gives the following error on 1.10.9:

...i/node_modules/.pnpm/@swc+core@1.3.41/node_modules/@swc/core/index.js:241
return bindings.transformSync(isModule ? JSON.stringify(src) : src, isModule, toBuffer(newOptions));
Error: Failed to deserialize buffer as swc::config::Options

If it helps, here's our .swcrc:

[
	{
		"$schema": "https://json.schemastore.org/swcrc",
		"env": {
			"targets": {
				"node": "20.15.1"
			}
		},
		"test": ".*.(ts|js)$",
		"jsc": {
			"target": "es2021",
			"externalHelpers": false,
			"parser": {
				"syntax": "typescript",
				"decorators": true,
				"dynamicImport": true
			},
			"keepClassNames": true,
			"loose": true,
			"transform": {
				"legacyDecorator": false,
				"decoratorMetadata": true
			}
		},
		"module": {
			"type": "commonjs"
		},
		"sourceMaps": "inline"
	},
	{
		"test": ".*.json$",
		"jsc": {
			"transform": {
				"optimizer": {
					"jsonify": {
						"minCost": 0
					}
				}
			}
		}
	}
]
@Brooooooklyn
Copy link
Member

@ab-geoff-plitt what's your @swc/core version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants