Error with inherited state in htmlbars template
See original GitHub issueI get the following error with the Ember addon when I try to extend a block with an state:
TemplateError: Can not apply multiple states at the same time from the exclusive state group “:scope[state|error]”
/* block-1.block.css */
:scope[state|error] {
...
}
/* block-2.block.css */
@block-reference block1 from "block-1.block.css";
:scope {
extends: block1
}
/* block-2.hbs */
<div state:error={{error}}></div>
When the state is not inherited, the build is fine:
/* block-1.block.css */
:scope[state|error] {
...
}
/* block-1.hbs */
<div state:error={{error}}></div>
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
HTMLBars in Ember Canary - Uncaught Error: Unknown ...
Yes, that error is basically indicating that your system is in an invalid state with regards to FSEvents. You can either reboot, or...
Read more >Ember.Templates.helpers - 2.6
Defined in packages/ember-routing-htmlbars/lib/keywords/action.js:9 ... change which type of component is rendered as the state of your application changes.
Read more >Flask html templates inheritance issue - mixed elements
The issue was, that I'd changed my IDE. Before I'd used PyCharm, then I switched to Visual Studio. It looks like they both...
Read more >Computed Properties - ember-cli-typescript
the callback form used with classic classes (based on EmberObject) ... to Octane eliminates this issue, since you mark reactive root state with...
Read more >Assemble a composite component - Storybook Tutorials
Next create Tasklist 's test states in the story file. Copy. app/components/task-list.stories.js. import { hbs } from 'ember-cli-htmlbars'; ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@GCheung55 You’re using the new syntax for 1.0 but the version of css-blocks that you’ve got installed is 0.24. You can either install
@css-blocks/ember-cli@next
or use the older syntax in your glimmer templates. I’m working on a new release for@next
with a lot of bug fixes right now… it should be out in the next day or two.Hey @dacoho, sorry for the slow reply – great sleuthing. That seems like a solid solution, but can we maybe add the existence check to
addDynamicAttr
so Analyzers don’t need to worry about this logic? My hope is forAnalysis
integration to be as straightforward as possible, if we already made this mistake in one of our own analyzers then it sounds like something that@css-blocks/core
can help validate for us!We can keep a faster model for style presence check on
ElementAnalysis
instead of iterating throughaddedStyles
each time.addDynamicAttr
(as well as all the other style application methods:addDynamicClasses
,addStaticClass
,addDynamicGroup
,addStaticAttr
) would use that to check if a Class or Attr has already been added. If yes, no-op, if no, add the Style(s).