3.0.2
https://github.com/07akioni/vue-inherit-attrs-bug
npm run dev

npm run build, then serve dist

I'm not sure which is expected by vue.
I expect the dev behavior
behavior is inconstant
I'd rather say that the dev behaviour is wrong.
However in dev, components can "accidentally return a fragment if they have one root node but also one or more root comments, which are preserved in dev, but not in prod.
So in dev, we "pull out" this root node from the fragment - and in this instance, that should not happen as no comments are involved.
Relevant code:
That function should not be called on a fragment resulting from a slot, or maybe check for actual Comment nodes to be present - not sure yet about the best approach.
Why attribute inheritance is not supported on fragments,is it limited by the difficulty of implementation? @LinusBorg
Because its unclear on which element to inherit.
The latter would create invalid HTML for an id attribute, for example, but it could be useful for a class.
I got it, thx.
Most helpful comment
I'd rather say that the dev behaviour is wrong.
However in dev, components can "accidentally return a fragment if they have one root node but also one or more root comments, which are preserved in dev, but not in prod.
So in dev, we "pull out" this root node from the fragment - and in this instance, that should not happen as no comments are involved.
Relevant code:
https://github.com/vuejs/vue-next/blob/f28ca556925147bb109d5ba77c5dafaf17d57322/packages/runtime-core/src/componentRenderUtils.ts#L216-L247
That function should not be called on a fragment resulting from a slot, or maybe check for actual Comment nodes to be present - not sure yet about the best approach.