Meituan-Dianping/mpvue · error

style="${String(staticStyle)}": Interpolation inside attribu

Error message

style="${String(staticStyle)}": Interpolation inside attributes has been deprecated. Use v-bind or the colon shorthand instead.

What it means

Dev-only compiler warning from the style module's transformNode: a static style attribute contains interpolation (style="{{ ... }}"), a deprecated Vue 1.x pattern. The dynamic detection flags it because binding must go through v-bind:style for reactivity and correct parsing in Vue 2.

Source

Thrown at packages/weex-template-compiler/build.js:3509

var klass = {
  staticKeys: ['staticClass'],
  transformNode: transformNode,
  genData: genData$1
};

/*  */

var normalize = cached(camelize);

function transformNode$1 (el, options) {
  var warn = options.warn || baseWarn;
  var staticStyle = getAndRemoveAttr(el, 'style');
  var ref = parseStaticStyle(staticStyle, options);
  var dynamic = ref.dynamic;
  var styleResult = ref.styleResult;
  if (process.env.NODE_ENV !== 'production' && dynamic) {
    warn(
      "style=\"" + (String(staticStyle)) + "\": " +
      'Interpolation inside attributes has been deprecated. ' +
      'Use v-bind or the colon shorthand instead.'
    );
  }
  if (!dynamic && styleResult) {
    el.staticStyle = styleResult;
  }
  var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  if (styleBinding) {
    el.styleBinding = styleBinding;
  } else if (dynamic) {
    el.styleBinding = styleResult;
  }
}

function genData$2 (el) {
  var data = '';

View on GitHub (pinned to 6c5d78ee04)

Solutions

  1. Replace interpolated style with :style binding, e.g. :style="styleObject"
  2. Keep purely static styles in the plain style attribute without interpolation
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/weex-template-compiler/build.js:3509 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Meituan-Dianping/mpvue@6c5d78ee04 (2026-09-02). Data as JSON: /api/errors/e414d8bbbd0fb14c. Report an issue: GitHub.