运行时出现错误ng build--prod。而且我也尝试运行,npm install但我也遇到了同样的错误。
ERROR in Module build failed: TypeError: Cannot read property 'replace' of undefined
at normalizeBackSlashDirection (D:\angular\blog\node_modules\webpack\lib\RequestShortener.js:15:17)
at new RequestShortener (D:\angular\blog\node_modules\webpack\lib\RequestShortener.js:25:15)
at new Compiler (D:\angular\blog\node_modules\webpack\lib\Compiler.js:136:27)
at Compiler.createChildCompiler (D:\angular\blog\node_modules\webpack\lib\Compiler.js:371:25)
at Compilation.createChildCompiler (D:\angular\blog\node_modules\webpack\lib\Compilation.js:1851:24)
at Object.pitch (D:\angular\blog\node_modules\mini-css-extract-plugin\dist\loader.js:70:43)
Run Code Online (Sandbox Code Playgroud)
我有一个 Array List 中的键列表。我只想同时从这些键中检索数据。
DatabaseReference mDBRef;
List<String> keys = new ArrayList<>();
Run Code Online (Sandbox Code Playgroud)
我用循环尝试了这个,但是模型类中的结果重复了 2 次。
for (int i= 0;i<keys.size();i++)
{
String id = keys.get(i);
Log.d("Keys",id);
mDBRef = FirebaseDatabase.getInstance().getReference().child("Gyms").child(id);
mDBRef.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(final DataSnapshot dataSnapshot) {
dataSnapshot.getKey();
gyms = dataSnapshot.getValue(Gyms.class);
if (gyms != null)
{
Log.d("Names",gyms.getName());
Toast.makeText(NearMeActivity.this, ""+ gyms.getName(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
Run Code Online (Sandbox Code Playgroud)