简体   繁体   English

为什么 shadow-cljs 在“陈旧输出”上返回此错误消息? 如何保证这栋楼的手表正在运行?

[英]Why is shadow-cljs returning this error message on "Stale Output"? How to guarantee the watch for this building is running?

I am new to Clojure and not a pro in Javascript.我是 Clojure 的新手,而不是 Javascript 的专家。 I am watching the free part of the course on Reagent .我正在观看Reagent课程的免费部分。

Following the instructions on the course's repo , after doing the git clone and the npm install , the author indicates running $ npm run dev .按照课程repo上的说明,在执行git clonenpm install之后,作者指示运行$ npm run dev Everything seems to work fine.一切似乎都很好。 I can see the app on my http://localhost:3000/ .我可以在我的http://localhost:3000/上看到该应用程序。

The favicon with the app's logo and its name is loaded on the corner of the browser's tab:带有应用程序徽标及其名称的 favicon 加载在浏览器选项卡的角落:

在此处输入图像描述

However, on the bottom of the web page, there is this error message from shadow-cljs :但是,在网页底部,有来自shadow-cljs错误消息:

shadow-cljs - Stale Output! shadow-cljs - 过时的输出! Your loaded JS was not produced by the running shadow-cljs instance.您加载的 JS 不是由正在运行的 shadow-cljs 实例生成的。 Is the watch for this build running?此构建的手表是否正在运行?

在此处输入图像描述

Why is this happening?为什么会这样? How should I fix it?我应该如何解决它? How to guarantee that the watch for this building is running?如何保证这栋楼的手表正在运行?

Is there a simple command to run on terminal to check this?是否有一个简单的命令可以在终端上运行来检查这个?

Obs.观察。 1 : If this is relevant, my operational system is NixOS and this is my config file . 1 :如果这是相关的,我的操作系统是 NixOS,这是我的配置文件

Obs.观察。 2 : I am not sure if this question is connected to my previous question on npm and Cider (Emacs IDE for Clojure) that happened while working with this same repo. 2 :我不确定这个问题是否与我之前在使用同一个 repo 时发生的关于npmCider (Emacs IDE for Clojure) 的问题相关联。

This happens to me when I clicked on the build link BEFORE it has compiled.当我在编译之前单击构建链接时,就会发生这种情况。 In which case, the link is displaying a previously compiled version, not the live version, and "watch" on code changes doesn't work either.在这种情况下,链接显示的是以前编译的版本,而不是实时版本,并且“监视”代码更改也不起作用。 Just wait for your terminal output to say "compiled" before clicking on the link.只需等待您的终端输出显示“已编译”,然后再单击链接。

It is likely that this is due to you running npm run dev AND cider-jack-in .这很可能是由于您运行了npm run devcider-jack-in

I don't use emacs, so I'm not exactly sure what cider-jack-in does, but I believe it launches a new JVM.我不使用 emacs,所以我不确定cider-jack-in是做什么的,但我相信它会启动一个新的 JVM。 Since the npm run dev also did that you end up with two running JVMs, which also means two running shadow-cljs instances.由于npm run dev也这样做了,因此您最终会得到两个正在运行的 JVM,这也意味着两个正在运行的shadow-cljs实例。 That is not ideal and they will start interfering with each other leading to errors such as yours.这并不理想,它们将开始相互干扰,从而导致像您这样的错误。

So, either you run npm run dev and use emacs to connect to that server.因此,您可以运行npm run dev并使用 emacs 连接到该服务器。 cider-connect or whatever is called should do that. cider-connect或任何被调用的东西都应该这样做。

Or you don't run npm run dev at all and instead only cider-jack-in and then start the watch from the REPL.或者你根本不运行npm run dev而是只运行cider-jack-in然后从 REPL 启动watch

Don't forget to first kill all java processes that might be running for that project.不要忘记首先杀死可能为该项目运行的所有 java 进程。 As long as there is more than one shadow-cljs process running for the project things will be weird.只要项目中运行的shadow-cljs进程不止一个,事情就会变得很奇怪。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么 CIDER 的 REPL 的行为不一致? 如何理解 shadow-cljs 的错误信息“No available JS runtime”? - Why is CIDER's REPL's behavior inconsistent? How to understand shadow-cljs' error message "No available JS runtime"? 在使用 shadow-cljs 观看应用程序时,我应该何时刷新浏览器以查看更改? 艰难的刷新和重建呢? - While using shadow-cljs to watch the app, when should I refresh the browser to see the changes? What about hard refreshing and rebuilding? 有没有办法在不同的会话中存储和检索 shadow-cljs 的 REPL 历史? 如何使用以前的命令? - Is there a way to store and retrieve the history of shadow-cljs' REPL over different sessions? How to use previous commands? 为什么 CIDER 的 REPL 有时以“shadow.user>”开头,而在其他情况下以“cljs.user>”开头? - Why CIDER's REPL some times start as "shadow.user>" and in others it starts as "cljs.user>"? 如何在 cljs 宏中管理依赖项? - How to manage dependencies in a cljs macro? 如何在苹果酒中运行自动化 cljs 测试? - How to run automate cljs tests in cider? 如何处理 cljs-ajax 响应? - How to handle cljs-ajax responses? ClojureScript编译器如何将cljs转换为Javascript - How does the ClojureScript compiler transform cljs to Javascript 如何在cljs中调用js实例的方法 - How to call a method of js instance in cljs 运行 ClojureScript:无法找到 cljs/main.clj - Running ClojureScript: Unable to locate cljs/main.clj
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM