-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
fix: Last, not first, non-external script in HTML should have prerender() #905
Conversation
🦋 Changeset detectedLatest commit: 4494e19 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
oooof, yeah. TBH that's a solid argument in favor of flipping the error message. I can think of cases where first script is likely not the correct one (polyfills), but I can also think of cases where the last script is incorrect (analytics). |
Size Change: +4 B (0%) Total Size: 806 kB
ℹ️ View Unchanged
|
Will do that instead (only thought of it after I pushed, whoops). Analytics will probably end up being external more often than not, ensuring they get skipped. So long as the error messages matches the behavior it should be an easy and quick correction anyways. |
The first script tag in the file should be assumed to have a
prerender()
, however, due to the loop continuing even after the first non-external script tag is found, it was actually the last script tag that was used and would need to haveprerender()
.It should be noted that this behavior has existed for the past 9 months, and fixing it could potentially cause someone's setup to break. We could just flip the error message/comments instead?
wmr/packages/wmr/src/lib/prerender.js
Line 106 in 039f799