对于laravel+mix+vue路由器错误:未找到导出“createStaticVNode”感兴趣的读者,本文将提供您所需要的所有信息,我们将详细讲解导入为“_createStaticVNode”,
对于laravel + mix + vue 路由器错误:未找到导出“createStaticVNode”感兴趣的读者,本文将提供您所需要的所有信息,我们将详细讲解导入为“_createStaticVNode”,并且为您提供关于Activity 永远不会成为请求状态“[DESTROYED, RESUMED, STARTED, CREATED]”(最后一个生命周期转换 =“PRE_ON_CREATE”)、cannot resolve method clearStatistics、com.amazonaws.services.cloudformation.model.CreateStackRequest的实例源码、com.amazonaws.services.cloudformation.model.CreateStackResult的实例源码的宝贵知识。
本文目录一览:- laravel + mix + vue 路由器错误:未找到导出“createStaticVNode”(导入为“_createStaticVNode”)
- Activity 永远不会成为请求状态“[DESTROYED, RESUMED, STARTED, CREATED]”(最后一个生命周期转换 =“PRE_ON_CREATE”)
- cannot resolve method clearStatistics
- com.amazonaws.services.cloudformation.model.CreateStackRequest的实例源码
- com.amazonaws.services.cloudformation.model.CreateStackResult的实例源码
laravel + mix + vue 路由器错误:未找到导出“createStaticVNode”(导入为“_createStaticVNode”)
如何解决laravel + mix + vue 路由器错误:未找到导出“createStaticVNode”(导入为“_createStaticVNode”)?
你好,我是 laravel 和 mix 的新手。现在我正在学习 jeffrey way vue 教程。这门课引起了很多问题。让我感到困惑和失望的是新问题。在第 26 集 (there) 中,当我尝试运行引发新错误的 watch 命令时:
警告在 ./resources/assets/js/views/Home.vue?vue&type=template&id=6c0a33b2 (./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!. /node_modules/vue-loader/dist/templateLoader.js??ruleSet1.rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0] !./resources/assets/js/views/Home.vue?vue&type=template&id=6c0a33b2) 6:30-48
在 ''vue'' 中找不到导出 ''createStaticVNode''(导入为 ''_createStaticVNode'')(可能的导出:默认)
有人可以帮我吗?
编辑:
项目文件内容:
route.js(资产/js):
import VueRouter from ''vue-router'';
let routes = [
{
path: ''/'',component: require(''./views/Home'')
}
];
export default new VueRouter({
routes
});
Home.vue (assets/js/views):
<template>
<div>
<div>
<div>
<divpanel panel-default''>
<divhttps://www.jb51.cc/tag/heading/" target="_blank">heading">
Home page
</div>
<div>
I''m an example compnoent!
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data () {
return {
msg: ''Hello World!''
}
}
}
</script>
app.js(用作入口点,保存在assets/js中)
import ''./bootstrap'';
import router from ''./routes'';
new Vue({
el: ''#app'',router
})
bootstrap.js(资产/js):
import Vue from ''vue'';
import VueRouter from ''vue-router'';
import axios from ''axios'';
window.Vue = Vue;
Vue.use(VueRouter);
window.axios = axios;
window.axios = require(''axios'');
window.axios.defaults.headers.common[''X-Requested-With''] = ''XMLHttpRequest''
解决方法
route.js(资产/js):
从''./routes''导入路由器;
您说的是您的路由器文件名 route.js
但您导入了 routes
!确保您的文件名正确或导入正确。
Activity 永远不会成为请求状态“[DESTROYED, RESUMED, STARTED, CREATED]”(最后一个生命周期转换 =“PRE_ON_CREATE”)
如何解决Activity 永远不会成为请求状态“[DESTROYED, RESUMED, STARTED, CREATED]”(最后一个生命周期转换 =“PRE_ON_CREATE”)?
这不是一个重复的问题。
我已经看过类似的问题。我已经添加了我最后提到的问题。
我的问题是测试执行,但我必须为每个测试手动打开应用程序。
你可以看到我在打开应用之前已经等待了 18 秒。它一直等到我手动打开应用程序或在超时后显示此错误。
Activity 永远不会成为请求状态“[DESTROYED,RESUMED,STARTED,CREATED]”(最后一个生命周期转换 =“PRE_ON_CREATE”)
从 this post 开始,我认为问题出在设备上,因为我使用的是 Redmi Note 5
。
我有 disabled animations
和 Miui optimization
选项。
感谢任何帮助自动在小米设备上运行测试。
手动运行自动化 UI 测试毫无意义。
更新 1
它仅对启动器/主要活动执行。
它不适用于其他活动。
更新 2
我也碰巧有一台 Redmi 4。测试在该设备上按预期运行,无需任何代码更改。
推荐的 SO 问题
- AndroidX.Test ActivityScenario: java.lang.AssertionError: Activity never becomes requested state "[RESUMED]" (last lifecycle transition = "STOPPED")
- Android device doesn''t launch activities on the screen while espresso testing
- Activity never becomes requested state in UI Testing
- java.lang.AssertionError: Activity never becomes requested state
- Android instrumented test throws exception: Activity never becomes requested state "[RESUMED,DESTROYED,CREATED]"
- How do I fix this error java.lang.AssertionError: Activity never becomes requested state "[DESTROYED]" (last lifecycle transition = "RESUMED")
及相关问题,
- https://github.com/android/android-test/issues/143
- https://github.com/android/android-test/issues/496
为任何想要查看的人添加代码片段和依赖项
测试代码
import androidx.test.core.app.ActivityScenario
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4ClassRunner::class)
class MainActivityTest {
@Test
fun test_isActivityInView() {
val activityScenario = ActivityScenario.launch(MainActivity::class.java)
onView(withId(R.id.layout_activity_main)).check(matches(isdisplayed()))
}
}
依赖关系
testImplementation "junit:junit:4.13.2"
androidTestImplementation "androidx.test:core:1.4.0"
androidTestImplementation "androidx.test:runner:1.4.0"
androidTestImplementation "androidx.test:rules:1.4.0"
androidTestImplementation "androidx.test.ext:junit-ktx:1.1.3"
androidTestImplementation "androidx.test.espresso:espresso-core:3.4.0"
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
cannot resolve method clearStatistics
CacheUsageAction 中 clear 方法使用了 clearStatistics 方法,编译时提示找不到 clearStatistics 这个方法。
@Action(value = "cache-clear", results = { @Result(type = "redirectAction", location = "cache-usage", params = {
"name", "${name}" }) })
public String clear() {
CacheManager manager = CacheManager.getInstance();
if (names != null && names.length > 0) {
for (String name : names) {
Cache cache = manager.getCache(name);
if (cache != null) {
cache.clearStatistics();
cache.removeAll();
}
}
} else {
manager.clearAll();
}
return SUCCESS;
}
原因分析:
net.sf.ehcache.Cache 来自版本 ehcache-2.10.0.jar
ehcache-2.10.0.jar 由 mes-core 引入,经过源代码分析发现,ehcache 的版本从 2.x.x 开始,Cache 没有 clearStatistics 方法。因此需要降级版本号为 1.6.0,错误立刻消失。
到此为止,虽然看似问题已经解决,但是运行的时候发现 hibernate 运行是依赖的 cache 也出现类型的不兼容问题。后来经过和历史版本的对比,发现不能使用 ehcache 系列的 jar 包,只能使用 ehchache-core 系列的 jar 包,更换为 ehcache-core-2.6.11.jar,所有问题得到解决。
com.amazonaws.services.cloudformation.model.CreateStackRequest的实例源码
/** * Creates a new stack. * * @param name Stack name. * @param parameters Input parameters. * @param templatePath Classpath to the JSON template of the stack. * @return Stack ID */ public String createStack(final String name,final Map<String,String> parameters,final String templatePath,final boolean iamCapabilities) { logger.info(String.format("Executing the Cloud Formation: %s,Stack Name: %s",templatePath,name)); final CreateStackRequest request = new CreateStackRequest() .withStackName(name) .withParameters(convertParameters(parameters)) .withTemplateBody(getTemplateText(templatePath)); if (iamCapabilities) { request.getCapabilities().add("CAPABILITY_IAM"); } final CreateStackResult result = cloudFormationClient.createStack(request); return result.getStackId(); }
public static StackNameAndId createTemporarySimpleStack(AmazonCloudFormation cfnClient,String vpcId,String arn) throws IOException { CreateStackRequest createStackRequest = new CreateStackRequest(); createStackRequest.setStackName(TEMPORARY_STACK); File file = new File(FilesForTesting.SIMPLE_STACK); createStackRequest.setTemplateBody(FileUtils.readFiletoString(file,Charset.defaultCharset())); Collection<Parameter> parameters = new LinkedList<>(); parameters.add(createParam("env",EnvironmentSetupForTests.ENV)); parameters.add(createParam("vpc",vpcId)); if (!arn.isEmpty()) { Collection<String> notificationARNs = new LinkedList<>(); notificationARNs.add(arn); logger.debug("Adding arn subscription "+ arn); createStackRequest.setNotificationARNs(notificationARNs); } createStackRequest.setParameters(parameters); CreateStackResult result = cfnClient.createStack(createStackRequest); return new StackNameAndId(TEMPORARY_STACK,result.getStackId()); }
private DescribeStackResourcesResult getStackResources(String stackName) throws InterruptedException,IOException { try { DescribeStacksResult describeStacksResult = this.amazonCloudFormationClient.describeStacks(new DescribeStacksRequest().withStackName(stackName)); for (Stack stack : describeStacksResult.getStacks()) { if (isAvailable(stack)) { return this.amazonCloudFormationClient.describeStackResources(new DescribeStackResourcesRequest().withStackName(stack.getStackName())); } if (isError(stack)) { if (this.stackCreatedByThisinstance) { throw new IllegalArgumentException("Could not create stack"); } this.amazonCloudFormationClient.deleteStack(new DeleteStackRequest().withStackName(stack.getStackName())); return getStackResources(stackName); } if (isInProgress(stack)) { //noinspection BusyWait Thread.sleep(5000L); return getStackResources(stackName); } } } catch (AmazonClientException e) { String templateBody = FilecopyUtils.copyToString(new InputStreamReader(new ClassPathResource(TEMPLATE_PATH).getInputStream())); this.amazonCloudFormationClient.createStack(new CreateStackRequest().withTemplateBody(templateBody).withOnFailure(OnFailure.DELETE). withStackName(stackName).withTags(new Tag().withKey("tag1").withValue("value1")). withParameters(new Parameter().withParameterKey("RdsPassword").withParameterValue(this.rdsPassword))); this.stackCreatedByThisinstance = true; } return getStackResources(stackName); }
public void execute() { checkParams(); AmazonCloudFormationClient client = getorCreateClient(AmazonCloudFormationClient.class); CreateStackRequest createStackRequest = new CreateStackRequest() .withdisableRollback(disableRollback).withOnFailure(onFailure) .withStackName(stackName).withStackPolicyBody(stackPolicyBody) .withStackPolicyURL(stackPolicyURL) .withTemplateBody(templateBody).withTemplateURL(templateURL) .withTimeoutInMinutes(timeoutInMinutes); if (capabilities.size() > 0) { createStackRequest.setCapabilities(capabilities); } if (parameters.size() > 0) { createStackRequest.setParameters(parameters); } if (tags.size() > 0) { createStackRequest.setTags(tags); } try { client.createStack(createStackRequest); System.out.println("Create stack " + stackName + " request submitted."); if(waitForCreation) { WaitForStackToReachStateTask.waitForCloudFormationStackToReachStatus(client,stackName,CREATE_COMPLETE); } } catch (Exception e) { throw new BuildException( "Could not create stack " + e.getMessage(),e); } }
private CreateStackRequest createCreateStackRequest(AuthenticatedContext ac,CloudStack stack,String cFStackName,String subnet,String cfTemplate) { return new CreateStackRequest() .withStackName(cFStackName) .withOnFailure(OnFailure.DO_nothing) .withTemplateBody(cfTemplate) .withTags(awsTagPreparationService.prepareTags(ac,stack.getTags())) .withCapabilities(CAPABILITY_IAM) .withParameters(getStackParameters(ac,stack,cFStackName,subnet)); }
@Test @Parameters({ "networkName","description","publicInAccount","regionName","vpcStackName","vpcName","existingsubnet" }) public void createNetwork(String networkName,@Optional("") String description,@Optional("false") boolean publicInAccount,String regionName,@Optional("it-vpc-stack") String vpcStackName,@Optional("it-vpc") String vpcName,boolean existingsubnet) { AmazonCloudFormationClient client = new AmazonCloudFormationClient(); client.setRegion(RegionUtils.getRegion(regionName)); Map<String,Object> networkMap = new HashMap<>(); String vpcCreationjson = existingsubnet ? "public_vpc_with_subnet.json" : "public_vpc_wihout_subnet.json"; try (InputStream vpcJsonInputStream = getClass().getResourceAsstream("/cloudformation/" + vpcCreationjson)) { String vpcCFTemplateString = IoUtils.toString(vpcJsonInputStream); CreateStackRequest stackRequest = createStackRequest(vpcStackName,vpcName,vpcCFTemplateString); client.createStack(stackRequest); List<Output> outputForRequest = getoutputForRequest(vpcStackName,client); if (existingsubnet) { networkMap.put("vpcId",outputForRequest.get(0).getoutputValue()); networkMap.put("subnetId",outputForRequest.get(1).getoutputValue()); } else { networkMap.put("vpcId",outputForRequest.get(1).getoutputValue()); networkMap.put("internetGatewayId",outputForRequest.get(0).getoutputValue()); } } catch (IOException e) { LOGGER.error("can't read vpc cloudformation template file"); throw new RuntimeException(e); } NetworkRequest networkRequest = new NetworkRequest(); networkRequest.setName(networkName); networkRequest.setDescription(description); networkRequest.setParameters(networkMap); if (!existingsubnet) { networkRequest.setsubnetCIDR("10.0.0.0/24"); } networkRequest.setCloudplatform("AWS"); String id = getCloudbreakClient().networkEndpoint().postPrivate(networkRequest).getId().toString(); getItContext().putContextParam(CloudbreakITContextConstants.NETWORK_ID,id,true); }
@Override protected void before() throws Throwable { try { String awsCredentialsDir = System.getProperty("aws.credentials.path"); File awsCredentialsFile = new File(awsCredentialsDir,"aws.credentials.properties"); Properties awsCredentials = new Properties(); awsCredentials.load(new FileReader(awsCredentialsFile)); String accessKey = awsCredentials.getProperty("cloud.aws.credentials.accessKey"); String secretKey = awsCredentials.getProperty("cloud.aws.credentials.secretKey"); this.cloudFormation = new AmazonCloudFormationClient(new BasicAWSCredentials(accessKey,secretKey)); YamlPropertiesfactorybean yamlPropertiesfactorybean = new YamlPropertiesfactorybean(); yamlPropertiesfactorybean.setResources(new ClassPathResource("application.yml")); Properties applicationProperties = yamlPropertiesfactorybean.getobject(); this.stackName = applicationProperties.getProperty("cloud.aws.stack.name"); after(); ClassPathResource stackTemplate = new ClassPathResource("AwsIntegrationTestTemplate.json"); String templateBody = FilecopyUtils.copyToString(new InputStreamReader(stackTemplate.getInputStream())); this.cloudFormation.createStack( new CreateStackRequest() .withTemplateBody(templateBody) .withOnFailure(OnFailure.DELETE) .withStackName(this.stackName)); waitForCompletion(); System.setProperty("cloud.aws.credentials.accessKey",accessKey); System.setProperty("cloud.aws.credentials.secretKey",secretKey); } catch (Exception e) { if (!(e instanceof AssumptionViolatedException)) { Assume.assumeTrue("Can't perform AWS integration test because of: " + e.getMessage(),false); } else { throw e; } } }
@Override public void addMonitoringTo(CreateStackRequest createStackRequest) { // does nothing in this implementation }
@Override public void addMonitoringTo(CreateStackRequest createStackRequest) throws NotReadyException { Collection<String> arns = getArns(); createStackRequest.setNotificationARNs(arns); }
/** */ public Stack stackCreate() throws Exception { final CreateStackRequest request = new CreateStackRequest(); request.withStackName(name); request.withParameters(paramList); request.withTemplateBody(template); amazonClient.createStack(request); final Stack stack = waitForStackCreate(); return stack; }
void addMonitoringTo(CreateStackRequest createStackRequest) throws NotReadyException;
com.amazonaws.services.cloudformation.model.CreateStackResult的实例源码
/** * Creates a new stack. * * @param name Stack name. * @param parameters Input parameters. * @param templatePath Classpath to the JSON template of the stack. * @return Stack ID */ public String createStack(final String name,final Map<String,String> parameters,final String templatePath,final boolean iamCapabilities) { logger.info(String.format("Executing the Cloud Formation: %s,Stack Name: %s",templatePath,name)); final CreateStackRequest request = new CreateStackRequest() .withStackName(name) .withParameters(convertParameters(parameters)) .withTemplateBody(getTemplateText(templatePath)); if (iamCapabilities) { request.getCapabilities().add("CAPABILITY_IAM"); } final CreateStackResult result = cloudFormationClient.createStack(request); return result.getStackId(); }
public static StackNameAndId createTemporarySimpleStack(AmazonCloudFormation cfnClient,String vpcId,String arn) throws IOException { CreateStackRequest createStackRequest = new CreateStackRequest(); createStackRequest.setStackName(TEMPORARY_STACK); File file = new File(FilesForTesting.SIMPLE_STACK); createStackRequest.setTemplateBody(FileUtils.readFiletoString(file,Charset.defaultCharset())); Collection<Parameter> parameters = new LinkedList<>(); parameters.add(createParam("env",EnvironmentSetupForTests.ENV)); parameters.add(createParam("vpc",vpcId)); if (!arn.isEmpty()) { Collection<String> notificationARNs = new LinkedList<>(); notificationARNs.add(arn); logger.debug("Adding arn subscription "+ arn); createStackRequest.setNotificationARNs(notificationARNs); } createStackRequest.setParameters(parameters); CreateStackResult result = cfnClient.createStack(createStackRequest); return new StackNameAndId(TEMPORARY_STACK,result.getStackId()); }
关于laravel + mix + vue 路由器错误:未找到导出“createStaticVNode”和导入为“_createStaticVNode”的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于Activity 永远不会成为请求状态“[DESTROYED, RESUMED, STARTED, CREATED]”(最后一个生命周期转换 =“PRE_ON_CREATE”)、cannot resolve method clearStatistics、com.amazonaws.services.cloudformation.model.CreateStackRequest的实例源码、com.amazonaws.services.cloudformation.model.CreateStackResult的实例源码的相关知识,请在本站寻找。
本文标签: