为了账号安全,请及时绑定邮箱和手机立即绑定

Sapper 不断收到客户关于“this”关键字的警告?

Sapper 不断收到客户关于“this”关键字的警告?

慕神8447489 2021-12-23 10:21:45
不断从客户端收到此警告,但不完全确定可能是什么原因造成的。任何正确方向的指导都会非常有帮助!• clientThe 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten1: var __extends = (this && this.__extends) || (function () {                    ^2:     var extendStatics = function (d, b) {3:         extendStatics = Object.setPrototypeOf ||The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten1: var __extends = (this && this.__extends) || (function () {                            ^2:     var extendStatics = function (d, b) {3:         extendStatics = Object.setPrototypeOf ||The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten1: var __assign = (this && this.__assign) || function () {                   ^2:     __assign = Object.assign || function(t) {3:         for (var s, i = 1, n = arguments.length; i < n; i++) {The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten1: var __assign = (this && this.__assign) || function () {                           ^2:     __assign = Object.assign || function(t) {3:         for (var s, i = 1, n = arguments.length; i < n; i++) {
查看完整描述

1 回答

?
幕布斯7119047

TA贡献1794条经验 获得超8个赞

我能够通过将以下代码添加到我的客户端汇总包来解决这个问题。

context: "window"

这是与此错误相关的文档:https : //rollupjs.org/guide/en/#error-this-is-undefined


查看完整回答
反对 回复 2021-12-23
  • 1 回答
  • 0 关注
  • 318 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信