File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
packages/ember-css-modules/lib/htmlbars-plugin Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -142,9 +142,18 @@ module.exports = class ClassTransformPlugin {
142142
143143 utils . pushAll ( parts , this . localToPath ( localClassAttr . value ) ) ;
144144 this . divide ( parts , 'text' ) ;
145- node . attributes . unshift (
146- this . builders . attr ( 'class' , this . builders . concat ( parts ) )
147- ) ;
145+
146+ let newClassAttr = this . builders . attr ( 'class' , this . builders . concat ( parts ) ) ;
147+ node . attributes . unshift ( newClassAttr ) ;
148+
149+ // In new-enough versions of Ember (>= 3.25 or so), we need to create a
150+ // fake good-enough `loc` whose content will start with `class=` to avoid
151+ // triggering https://github.com/emberjs/ember.js/issues/19392
152+ if ( typeof localClassAttr . loc . slice === 'function' ) {
153+ newClassAttr . loc = localClassAttr . loc . slice ( {
154+ skipStart : 'local-' . length ,
155+ } ) ;
156+ }
148157 }
149158
150159 localToPath ( node ) {
You can’t perform that action at this time.
0 commit comments