detect-browser icon indicating copy to clipboard operation
detect-browser copied to clipboard

`this` has been rewritten to `undefined` on the new version of rollup

Open iceleo-com opened this issue 3 years ago • 3 comments

Hi sir/madam,

I run into this issue with the latest version of rollup js

(!) `this` has been rewritten to `undefined`
https://rollupjs.org/guide/en/#error-this-is-undefined
node_modules/detect-browser/es/index.js
1: var __spreadArrays = (this && this.__spreadArrays) || function () {
                         ^
2:     for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
3:     for (var r = Array(s), k = 0, i = 0; i < il; i++)
...and 1 other occurrence

May you adjust your lib to work with rollup js?

Thankyou for your hard work!

iceleo-com avatar Apr 01 '21 03:04 iceleo-com

I will definitely take a look - thanks for reporting the issue!

DamonOehlman avatar Apr 01 '21 04:04 DamonOehlman

still got this warning. I read @xon52 refs, seems work when set this package in external. But I need make it bundle in my package. Any help is appreciated

iulo avatar Feb 25 '22 04:02 iulo

+1 on this issue

deeeed avatar Jan 09 '23 03:01 deeeed