diff --git a/remix-solidity/src/compiler/compiler-input.js b/remix-solidity/src/compiler/compiler-input.js
index <HASH>..<HASH> 100644
--- a/remix-solidity/src/compiler/compiler-input.js
+++ b/remix-solidity/src/compiler/compiler-input.js
@@ -7,8 +7,7 @@ module.exports = (sources, opts) => {
     settings: {
       optimizer: {
         enabled: opts.optimize === true || opts.optimize === 1,
-        runs: 200,
-        details: {}
+        runs: 200
       },
       libraries: opts.libraries,
       outputSelection: {
@@ -25,8 +24,9 @@ module.exports = (sources, opts) => {
   if (opts.language) {
     o.language = opts.language
   }
-  if (opts.language === 'Yul' && o.settings.optimizer.enabled)
-  {
+  if (opts.language === 'Yul' && o.settings.optimizer.enabled) {
+    // details key is valid only for Yul
+    if (!o.settings.optimizer.details) o.settings.optimizer.details = {}
     o.settings.optimizer.details['yul'] = true
   }
   return JSON.stringify(o)
removed 'detail' key of optimizer for versions before yul