kwonoj/swc-plugin-coverage-instrument

Missing export `__transform_plugin_process_impl`

stahlbauer opened this issue · 4 comments

Context

I am trying to use the plugin with the current SWC version for instrumenting a JS code snippet.

The following call is performed:

	const pluginOptions = {
		inputSourceMap: sourceMap
	};

	return swc.transformSync(sourceContent, {
		filename: sourceFilename,
		sourceMaps: true,
		inlineSourcesContent: false,
		minify: false,
		isModule: true,
		jsc: {
			experimental: {
				plugins: [['swc-plugin-coverage-instrument', pluginOptions]]
			}
		}
	});

Problem

The call fails with:

Error: failed to handle: failed to invoke plugin: failed to invoke plugin on 'Some("test.js")'

Caused by:
    Missing export __transform_plugin_process_impl

The problem seems to be related to swc-project/swc@e8214ba

There is already a PR that is supposed to fix this: #165

It would be great if there would be information on the required/expected dependencies of this plugin to try it out.

For example, the plugin version 0.0.6 works with version 1.2.185 of SWC.

Since you already found out relavant issue, let me close this and update PR as needed.

As you aware currently there's some rough edges between swc/core host version to the plugins, which I expect to be stablized better with few more changes I am attempt to make in swc/core. Once it's done, picking latest core / plugin would work.