Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip checking the source for synthetic attributes to prevent warning. #1431

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

navels
Copy link
Contributor

@navels navels commented May 27, 2023

This fixes a warning caused when template parsing encounters a synthetic attribute (i.e., inserted by a plugin). For example, building the ember-maybe-in-element addon outputs these warnings:

unexpectedly found "<div id=\"original-p" when slicing source, but expected "@destinationElement"
unexpectedly found "<div id=\"origi" when slicing source, but expected "@renderInPlace"
unexpectedly found "    \n      <div id=" when slicing source, but expected "@destinationElement"
unexpectedly found "    \n      <di" when slicing source, but expected "@renderInPlace"

and the same will happen for any app that uses the ember-basic-dropdown addon (which uses the above addon).

These should fix the remaining causes of emberjs/ember.js#19392 that are not already fixed by #1430.

I tried to add a test that would be even vaguely useful and couldn't really come up with anything.

backspace added a commit to cardstack/boxel that referenced this pull request Jun 15, 2023
backspace added a commit to cardstack/boxel that referenced this pull request Jun 15, 2023
@wycats wycats self-assigned this May 16, 2024
@acorncom
Copy link
Member

I've been helping a client with some upgrades recently and found this message went away once the app was upgraded to 5.12. Probably can close now? You can see that other folks handled this by patching temporarily using pnpm patch options

@wycats wycats closed this Nov 13, 2024
@navels
Copy link
Contributor Author

navels commented Nov 13, 2024

Might want to leave this open based on this comment: #1430 (comment)

@acorncom acorncom reopened this Nov 14, 2024
@acorncom
Copy link
Member

@navels thanks, will do

chancancode added a commit that referenced this pull request Feb 21, 2025
Re-apply #1430 with a more robust implementation and tests

Also turns the warning into a `localAssert()` so it gets stripped
before reaching downstream consumers.

This relates to #1431 in that this removes the warning, so to the
extent that #1431 was motivated by sliencing the warning in Ember
builds, it avoids the issue. But I haven't investigated the root
cause of that issue and whether it is indicative of an actual bug
somewhere deeper.

Fixes emberjs/ember.js#19392

Co-authored-by: Lee Nave <[email protected]>
chancancode added a commit that referenced this pull request Feb 21, 2025
Re-apply #1430 with a more robust implementation and tests

Also turns the warning into a `localAssert()` so it gets stripped
before reaching downstream consumers.

This relates to #1431 in that this removes the warning, so to the
extent that #1431 was motivated by sliencing the warning in Ember
builds, it avoids the issue. But I haven't investigated the root
cause of that issue and whether it is indicative of an actual bug
somewhere deeper.

Fixes emberjs/ember.js#19392

Co-authored-by: Lee Nave <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants