我正在尝试为生产构建一个 vue.js 应用程序。此错误消息总是在中途出现。
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Run Code Online (Sandbox Code Playgroud)
我已经尝试通过添加来增加内存--max_old_space_size=4096,甚至尝试将其更改为8192,但无济于事。我使用的是带有 8 GB RAM 的 Mac,所以我不确定为什么会发生这种情况。
这是我为npm run build运行的代码:
vue-cli-service build --max_old_space_size=4096
Run Code Online (Sandbox Code Playgroud) 我有一个命名空间路由,这是我创建控制器的方法:
module A
module B
module Test
class DummyController < ApplicationController
def quantify_stocks
something = Test::Dummy::Something.new(params)
# more code here
end
end
end
end
end
Run Code Online (Sandbox Code Playgroud)
我正在尝试访问该类,Test::Dummy::Something但是它会使用A和B(A::B::Test)自动加载常量Test ?
我得到的错误是:
NameError (uninitialized constant A::B::Test::Dummy)
Run Code Online (Sandbox Code Playgroud)