Skip to content

Commit

Permalink
context
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Apr 1, 2024
1 parent 504ddb9 commit 373973c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions crates/swc_plugin_runner/src/transform_executor.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{env, sync::Arc};

use anyhow::{anyhow, Error};
use anyhow::{anyhow, Context, Error};
use parking_lot::Mutex;
#[cfg(feature = "__rkyv")]
use swc_common::plugin::serialized::{PluginError, PluginSerializedBytes};
Expand Down Expand Up @@ -389,6 +389,13 @@ impl TransformExecutor {
) -> Result<PluginSerializedBytes, Error> {
let mut transform_state = self.setup_plugin_env_exports()?;
transform_state.is_transform_schema_compatible()?;
transform_state.run(program, self.unresolved_mark, should_enable_comments_proxy)
transform_state
.run(program, self.unresolved_mark, should_enable_comments_proxy)
.context(
"failed to run Wasm plugin transform. Please ensure the version of `swc_core` \
used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-core\
for compatibility information. If you are an author of the plugin, please update \
`swc_core` to the compatible version.",
)
}
}

0 comments on commit 373973c

Please sign in to comment.