最近我开始学习Box2D引擎。我偶然发现了一个错误,却找不到原因。从firebug控制台: TypeError:groundBd.AddShape不是一个函数。groundBd.AddShape(groundSd);
以防万一,下面是我正在读-js文件的那本书的代码-
var carGame = {
}
var canvas;
var ctx;
var canvasWidth;
var canvasHeight;
$(function() {
// create the world
carGame.world = createWorld();
//
我遇到的问题,刚刚开始昨天,2021年12月7日左右,东部时间中午。我在Docker容器中部署了一个NextJS应用程序。在生产模式下从容器中部署此应用程序,现在会给出一个空白页面,并在浏览器控制台中出现一个小错误(更详细的信息如下)。
在昨天之前,我没有遇到过这样的问题。
此问题可在运行在AWS EC2实例和我的本地计算机上的Docker容器中复制。在使用npm run dev进行本地开发时,以及在码头容器外运行npm run build && npm run start时,都不会显示错误。在我的本地开发环境上,所有东西都开发、构建和显示得很好。
在docker容器中,我可以
我正在试图找出我在代码中遇到的一个bug。我编写了一个简单的示例,它使用类a、b和条目文件c复制了bug。
我的代码哪里出错了?
编辑
许多答案都与我的代码结构有关!我想澄清所需的功能。
a:需要b的一个静态实例。因此,A需要B。
b的函数(无静态的):只接受作为instanceof a的对象。因此,B需要要求A。
具体来说,我有一个“短语”类(a)和“分析器”类(b)。解析器只接受短语。短语在创建时使用其静态解析器实例解析其自身。
a.js
'use strict';
let b = require('./b.js');
class a {
我在一个流星应用程序中使用react。在开发模式下运行时,它工作得很好,但是当我在生产模式下运行它并且代码被缩小时,当应用程序加载时,我会得到下面的ReferenceError和浏览器控制台中的小型化反应错误。当我试图部署它时,也会发生同样的情况。
它正在被缩小使用在中构建的。当我meteor remove这个包时,它工作得很好,所以它肯定是小型化的。
我很困惑。我知道所讨论的行是react-dom的一部分,但我不知道是哪一部分,或者为什么它只在缩小后抛出一个错误。
说:
Should have found an error boundary. This error is likely cau
在运行Vue.js应用程序时,我在控制台中收到警告,无法确定它来自何处(在源代码中),也无法确定它是从哪个组件引发的。
以下是控制台输出:
TypeError: Cannot read property 'length' of undefined
at _c.attrs.rules (eval at ./node_modules/vue-loader/lib/template-compiler/index.js?{"id":"data-v-012a975a","hasScoped":true,"op
在我正在开发的vue.js应用程序中,我突然发现Chrome检查器中出现了一个错误:
Uncaught TypeError: c.querySelectorAll is not a function
它总是阻止死刑的执行。当我还能继续的时候,它似乎不会引起任何额外的问题。但我不能这样工作,如果我必须点击几次后,每次点击继续。
在调试器中,我可以看到c是一个变量,引用DOM中的注释。它会影响不同的评论。但是所有的注释都有一个共同点,即它们是由vue.js插入的,这是动态元素的占位符。
在堆栈跟踪中,几乎没有我的代码(参见下面的示例)。
(anonymous) (content_script_bu
我有一个普通的Nuxt设置,在尝试使用fetch()钩子呈现页面时得到以下错误: 错误: [Vue warn]: Property or method "$fetchState" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https
我在前端创建了一个数据集,当我使用导出函数时,js会报告一个错误,导出不会生成相应的url。我可以在前端使用导出吗?
router.js?version=b1068982:243 Uncaught Error: The route "oro_datagrid_export_action" does not exist.
at Router.getRoute (router.js?version=b1068982:243)
at Router.generate (router.js?version=b1068982:266)
at ExportAction.getLink (ab
我不确定标题是否正确,我会尽我所能解释:
我有4页,分别是a1.vue,a2.vue,b1.vue和b2.vue
我的router/index.js:
import a1 from '@/components/a1';
import a2 from '@/components/a2';
import b1 from '@/components/b1';
import b2 from '@/components/b2';
var router = new Router({
routes: [{
我正在将我的React项目从v15迁移到v16。当我这样做的时候,我面临着下面的错误
未定义的TypeError:无法读取未定义的属性“oneOf”
以下是完全错误:
Uncaught TypeError: Cannot read property 'oneOf' of undefined
at Object.eval (alert.js?b73b:1209)
at __webpack_require__ (alert.js?b73b:30)
at Object.eval (alert.js?b73b:472)
at Object.eval (alert.js?b73b
我已经设置了一个简单的Vue应用程序,应该连接到带有Websockets的nodeJS服务器。 我使用的是socket.io-extended。 我已经使用文档将websocket连接插入到一个组件中。刷新页面时,连接工作正常,没有问题。但是,当我使用vue路由器切换页面,然后返回到websocket页面时,我得到以下控制台消息: vue.runtime.esm.js?2b0e:619 [Vue warn]: Error in mounted hook: "TypeError: this.$socket.$subscribe is not a function"
found
我正在使用Angular,但在服务器上的生产环境中,我得到了这个错误: https://daphneprojects.nl/invoices see here at this link.
Error: Uncaught (in promise): NullInjectorError: StaticInjectorError[A -> A]:
StaticInjectorError(Platform: core)[A -> A]:
NullInjectorError: No provider for A!
NullInjectorError: StaticInje
我在b.js文件中定义了一些类(在本例中名为b.js),在b.js.flow文件中定义了它的声明。我假设error类型将类与它的声明关联起来,但不幸的是,当我试图使用接受类B实例的函数时,它的方法error类型引发了以下错误:
b.js:9
9: return this.a.foo(this)
^^^^^^^^^^^^^^^^ call of method `foo`
5: export default class B {
^ B. This type is incompatible with
为什么这段代码不能工作?
我有下面的app.ts
var a = 1;
var b = 3;
console.log(`Before a = ${a}, b = ${b}`);
[a, b] = [b, a];
console.log(`After a = ${a}, b = ${b}`);
当我试着用
节点app.ts
我有下一个:
[a, b] = [b, a];
^
ReferenceError: Invalid left-hand side in assignment
at exports.runInThisContext (vm.js:53:16)
at
问题
有一个通用的应用程序,它使用服务工作者。
最近从角6.1升级到7。
将更新的文件上载到服务器后,获取:
详细信息:
The script has an unsupported MIME type ('text/html'). Failed to load resource: net::ERR_INSECURE_RESPONSE main.2733b77522d2feee4713.js:1 ERROR Error: Uncaught (in promise): SecurityError: Failed to register a ServiceWorker: T
我在一个项目中使用了requirejs,我有两个模块:
a.js:是一个非AMD模块,我不能碰它的代码。
b.js:是我用define()函数编写的一个AMD模块。它需要a.js才能工作。
app.js:是使用a.js和b.js的实际应用程序代码。
app.js看起来是这样的:
//source code for app.js
require(['a.js', 'b.js'],
function( a, b ) {
a.x = 2;//this will fail because 'a' is not defined
Angular应用程序在开发模式下运行良好,甚至在使用--prod --optimization=false时也运行良好,但当我使用--prod --optimization=true构建时(我猜默认情况下优化是正确的),我得到以下错误。 关于在哪里查找错误或如何调试此错误,您有什么想法吗?如果有帮助的话,我还在下面粘贴我的package.json依赖项。 [Error] ERROR
Error: Uncaught (in promise): TypeError: undefined is not a constructor (evaluating 'new Lt.Subject
我有一个父类文件A.js和一个子类文件B.js
//A.js
class A {
constructor(){
console.log(__filename)
}
}
//B.js
class B extends A {
constructor() {
super();
}
}
new B()
//will output A.js
有没有办法在a.js中获取B.js路径?