wessberg / polyfiller Goto Github PK
View Code? Open in Web Editor NEWNever worry about polyfills again.
Home Page: https://polyfill.app
License: MIT License
Never worry about polyfills again.
Home Page: https://polyfill.app
License: MIT License
We just had a massive traffic spike which has bottlenecked the CPU severely to the point where it denies service for everyone. To work around this without increasing costs rapidly, we night some internal queue system.
Failed to load resource: The certificate for this server is invalid. You might be connecting to a server that is pretending to be “polyfill.app” which could put your confidential information at risk.
Error is shown and request is blocked.
Seems to work in major and current browsers. Not sure how long this has been an issue.
This is my current script tag:
<script crossorigin src="https://polyfill.app/api/polyfill?features=es,fetch,pointer-event,scroll-behavior,resize-observer|force"></script>
An hour ago I got this error on Sentry:
For some reason ResizeObserver
is not being polyfilled.
This is the user agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Mobile/15E148 Safari/604.1
I cannot reproduce this but I got this error from one of my users in Sentry
Does this make sense to you?
TypeError: Invalid character in header field name
--
arguments | [{"message":"Invalid character in header field name","name":"TypeError","stack":"TypeError: Invalid character in header field name\n at normalizeName (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:75432)\n at Headers.append (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:76247)\n at Headers.<anonymous> (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:76159)\n at Array.forEach (<anonymous>)\n at new Headers (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:76131)\n at new Request (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:81348)\n at https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:83734\n at new Promise (<anonymous>)\n at fetch (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:83685)\n at https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:914256\n at https://app.usebubbles.com/static/js/main.79af2afc.chunk.js:1:175882\n at u (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:471028)\n at Generator._invoke (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:470781)\n at Generator.forEach.e.<computed> [as next] (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:471385)\n at r (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:34154)\n at s (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:34357)\n at https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:34416\n at new Promise (<anonymous>)\n at https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:34297\n at https://app.usebubbles.com/static/js/main.79af2afc.chunk.js:1:176085\n at https://app.usebubbles.com/static/js/main.79af2afc.chunk.js:1:172971\n at u (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:471028)\n at Generator._invoke (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:470781)\n at Gene..."}]
https://polyfill.app/ The certificate expires on Nov 5th.
Unable to get property 'a' of undefined or null reference
Also, the scroll-behaviour polyfill doesn't seem to be applied
Browser:
User agent:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 QBCore/4.0.1301.400 QQBrowser/9.0.2524.400 Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2875.116 Safari/537.36 NetType/WIFI MicroMessenger/7.0.5 WindowsWechat
Error:
Code:
<script crossorigin src="https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior,es"></script>
It should polyfill es --> es.string --> padStart but it doesn't.
The error can be reproduced as the following:
const request = require("request");
function withUserAgent(userAgent) {
return {
url: "https://polyfill.app/api/polyfill?features=intl.list-format",
headers: {
"User-Agent": userAgent
}
};
}
// this is a real user agent from mi browser in a Xiaomi phone
const chrome71xiaomi = "Mozilla/5.0 (Linux; U; Android 10; en-us; SM-G975F Build/QP1A.190711.020) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.1.3-g";
// this is a real user agent from a Pixel 2 XL
const chrome71 = "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.141 Mobile Safari/537.36";
// This one is just like the above one, but with "XiaoMi/MiuiBrowser/12.1.3-g" added at the end
const chrome71fake = "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.1.3-g";
request(
withUserAgent(chrome71xiaomi),
(error, response, body) => console.log("chrome71xiaomi: ", body.length)
);
request(
withUserAgent(chrome71),
(error, response, body) => console.log("chrome71: ", body.length)
);
request(
withUserAgent(chrome71fake),
(error, response, body) => console.log("chrome71fake: ", body.length)
);
The resulting log is:
chrome71xiaomi: 0
chrome71fake: 0
chrome71: 15477
Which is obviously an error.
An Error occurred.
Code: 500
ENOSPC: no space left on device, open '/tmp/@wessberg/polyfiller/production/85d70e21d508715396c51d67992a98f7ced0eac7'
@wessberg - I have the domain polyfiller.io
going if you want if its on Hover.com currently and is $49.74 annually. I don't want any money for it just want to see it go to an appropriate home rather than being picked off and sat on by someone trying tomake money from it.
If the context
flag is given, we can filter out polyfills that isn't supported in that realm (unless the force
modifier is given also)
I'm using polyfiller to allow the use of scroll-behaviour and it work great on MacOS safari but on IOS it not doing anything not even scrolling
<script crossorigin src="https://polyfill.app/api/polyfill?minify&sourcemap&features=scroll-behavior"></script>
....
target.scrollIntoView({
behavior: 'smooth'
})
https://polyfill.app/api/polyfill?features=scroll-behavior
An Error occurred.
Code: 500
Value undefined out of range for undefined options property undefined
Using the Intl polyfill on Android 4.4 does not work (Intl.PluralRules specifically) because the Chrome version for Android 4.4 (v30) does not allow for window.Intl
to be assigned. Could window.Intl.PluralRules
be assigned directly instead?
https://github.com/wessberg/Polyfiller/blob/master/polyfill-lib/intl/intl.js#L5818
I was experimenting with the Intl polyfill API, and noticed a problem when running a RelativeTimeFormat command from MDN.
Loading "https://polyfill.app/api/polyfill?features=intl.relative-time-format|force,locales=en" into my page and then running var rtf1 = new Intl.RelativeTimeFormat('en', { style: 'narrow' });
, I receive the error "ReferenceError: Could not determine locale: No default locale has been configured". This happens in both Safari and Firefox, but not Chrome.
Am I missing a step somewhere, or is the default locale not being added?
Hey there,
Thanks for making Polyfiller!
I'm using the following URL to polyfill es
, intl
(Dutch) and fetch
: https://polyfill.app/api/polyfill?features=es,intl|locale=nl,fetch
However, this returns an error when using Chrome 86:
An Error occurred.
Code: 500
BrowserslistError
BrowserslistError: Unknown version 86 of chrome at Function.select (/app/node_modules/browserslist/index.js:1086:17) at /app/node_modules/browserslist/index.js:336:33 at Array.reduce () at resolve (/app/node_modules/browserslist/index.js:318:18) at browserslist (/app/node_modules/browserslist/index.js:443:21) at normalizeBrowserslist (/app/node_modules/@wessberg/browserslist-generator/dist/cjs/index.js:741:12) at generateBrowserslistFromUseragent (/app/node_modules/@wessberg/browserslist-generator/dist/cjs/index.js:1461:36) at Object.userAgentSupportsFeatures (/app/node_modules/@wessberg/browserslist-generator/dist/cjs/index.js:1501:35) at shouldIncludePolyfill (/app/dist/index.js:3456:102) at polyfillSet.forEach.polyfill (/app/dist/index.js:3491:13)
BrowserslistError: Unknown version 86 of chrome
Any idea what might be going on?
When I open https://app.usebubbles.com the request to polyfill.app/api/polyfill
does not return response, which makes the whole app stuck and waiting it. Can be reproduced in Chrome Canary 92.0.4473.0 canary (x86_64). Is not reproduced in stable version 89.0.4389.114 (x86_64)
curl 'https://polyfill.app/api/polyfill?features=fetch,pointer-event,scroll-behavior,es' \
-H 'Connection: keep-alive' \
-H 'Pragma: no-cache' \
-H 'Cache-Control: no-cache' \
-H 'sec-ch-ua: "Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"' \
-H 'Origin: https://app.usebubbles.com' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4473.0 Safari/537.36' \
-H 'Accept: */*' \
-H 'Sec-Fetch-Site: cross-site' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Dest: script' \
-H 'Referer: https://app.usebubbles.com/' \
-H 'Accept-Language: en-US,en;q=0.9,ru;q=0.8,uk;q=0.7' \
--compressed
After timeout I see the following error in console:
Access to script at 'https://polyfill.app/api/polyfill?features=fetch,pointer-event,scroll-behavior,es' from origin 'https://app.usebubbles.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
app.usebubbles.com/:1
GET https://polyfill.app/api/polyfill?features=fetch,pointer-event,scroll-behavior,es net::ERR_FAILED
An Error occurred.
Code: 500
ENOSPC: no space left on device, write
I'm using Intl.Collator
to compare some strings and also the Intl.ListFormat
polyfill on the same app. My app fails while trying to create a instance of the Intl.Collator
class.
Importing with the url: https://polyfill.app/api/polyfill?features=intl.list-format
Pen to reproduce: https://jsbin.com/peyulegiba/edit?html,js,output
(Opening in a browser that loads and applies the polyfill, yields undefined instead of function Collator())
When debugging on mobile Safari 12, i found the overriding line:
Polyfiller/polyfill-lib/intl/intl.js
Line 5818 in 3bffbad
Probably just coping over the Intl.Collator to the polyfilled Intl will solve the issue.
window.Intl = Object.assign(window.Intl, Intl$1);
Thanks for the awesome service, looking forward to use the custom-elements polyfill next. =D
Error in access to script:
https://polyfill.app/api/polyfill?features=broadcast-channel
nginx/1.18.0 (Ubuntu)
This suddenly started happening (again).
See this error in production:
Our index.html:
<script crossorigin src="https://polyfill.app/api/polyfill?features=fetch,pointer-event,scroll-behavior,es"></script>
Hey, the polyfill for Intl.ListFormat is failing on Safari v14.0.
Repro steps:
new Intl.ListFormat('en')
in consoleReferenceError: Could not determine locale: No default locale has been configured
Is this a bug in the polyfill?
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 LightSpeed [FBAN/MessengerLiteForiOS;FBAV/253.1.0.43.116;FBBV/200174216;FBDV/iPhone11,6;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/3;FBCR/;FBID/phone;FBLC/en_US;FBOP/0]
This is a version of the Safari browser on iOS. For some reason the resize observer is not polyfilled even with this script tag:
<script crossorigin src="https://polyfill.app/api/polyfill?features=es,fetch,pointer-event,scroll-behavior,resize-observer"></script>
The "never worry about polyfills again" tagline is not true in this case, because a polyfill is clearly not being loaded.
I'm referring to the pointer-event
feature.
It is not supported on Firefox for Android 68.
Yet when use Polyfiller like so:
<script crossorigin src="https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior"></script>
The polyfill is not loaded. When I change it to:
<script crossorigin src="https://polyfill.app/api/polyfill?features=url,fetch,pointer-event|force,scroll-behavior"></script>
It suddenly starts polyfilling and pointer events are detected.
Browser: https://whatsmybrowser.org/b/BY983
I'm trying to migrate from polyfill-library and I'm missing a couple of polyfills:
Not sure how hard could be to add those into the library.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.