Comments (11)
Really? I will have a look into it when I have time.
On the other hand, I remembered that the hotImport
feature is working inside Docker container too.
from getting-started.
I think ... the await hotImport in async function onMessage that is causing the problem.
Moving the await hotImport
out of the async onMessage event-handling function solved the problem, because the redefinition was indeed the problem.
from getting-started.
Made another attempt to fix it myself, still nok
from getting-started.
Hi, I did not use a constant in hotMod before, however, I had just checked the document and it seems should support it. (at https://github.com/zixia/hot-import )
Can you try to run the example at https://github.com/zixia/hot-import#full-example ? the source is at https://github.com/zixia/hot-import/blob/master/examples/demo-js.ts
I'll also have a look into your code(which use a constant in module like cfg.db.host
) later.
from getting-started.
Yeah, the demo-js.ts works fine for me, I've tested it as
both work fine.
from getting-started.
I think the problem is not constant in hotMod, but the **await** hotImport
in **async** function onMessage
that is causing the problem.
Once again, It works for the first received message but not the second.
from getting-started.
Did you find any way to resolve this issue and could you share it for us? Thanks.
from getting-started.
Yes, we should only use hotImport
once for a module from the beginning of the code.
Glad to hear from you that this issue had been fixed. Cheers and happy Christmas!
from getting-started.
Oh, actually it is not working -- It seems working because I have a let cfg = require('./config')
at the top of the script, but I was not able to make it hotImported.
Reopening it, and hope someone can put hot-import config into the demo of https://github.com/wechaty/wechaty-getting-started/tree/master/examples/professional/hot-import-bot
It isn't hard for me if I know nodejs well.
thx
from getting-started.
The same problem happens to me too, if it's imported twice there's a problem. The error repros on docker
from getting-started.
I changed to this
if(!config)
{
config = await hotImport('./config.js')
}
from getting-started.
Related Issues (20)
- Why can't I receive messages from the group after I change the group name
- "wechaty": "^1.20.2", 这个版本下 不支持js环境吗,我没有用ts HOT 1
- 为什么不能发送微信语音 HOT 5
- Gitpod doesn't work
- Message ready() payload.talkerId not exist HOT 1
- The requested module 'wechaty' does not provide an export named
- Error: execute proxyWechaty(init) error: 503, init() without a ready angularenv HOT 4
- Module '"wechaty"' has no exported member 'MessageType'.
- 使用npm start之后占用内存过高,高达10g HOT 1
- 扫描二维码不能登陆 service unavailable for this account
- npm install error 依赖安装失败 HOT 6
- 企业微信扫码后手机端出现了新设备登录提醒
- Error: @swc/core threw an error when attempting to validate swc compiler options. You may be using an old version of swc which does not support the options used by ts-node. Try upgrading to the latest version of swc. HOT 1
- Contact FindAll() API does not work.
- 直接引入Friendship失败 HOT 1
- [TypeError]: Cannot read properties of undefined (reading 'status')
- npm install err HOT 2
- SyntaxError: Unexpected token ':'
- 直接启动报错 Maximum number of redirects exceeded
- npm start 显示令牌,服务地址命名已经设置为新的地址,却还是api.chat.io
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from getting-started.