diff --git a/packages/dd-trace/src/proxy.js b/packages/dd-trace/src/proxy.js index 3228145a67d..57b0aca3691 100644 --- a/packages/dd-trace/src/proxy.js +++ b/packages/dd-trace/src/proxy.js @@ -117,10 +117,11 @@ class Tracer extends NoopProxy { if (config.iast.enabled) { require('./appsec/iast').enable(config, this._tracer) } - } else { + } else if (this._tracingInitialized) { require('./appsec').disable() require('./appsec/iast').disable() } + if (this._tracingInitialized) { this._tracer.configure(config) this._pluginManager.configure(config)