[2025-05-22]Records of Problems about WordPress & React, Node.js & AWS / 关于WordPress & React、Node.js & AWS的问题记录

WordPress

Old Problem: Custom Component Didn’t Show Up

Don’t show the custom component: While it was my fault… I commented out the codes for less functions to deliver faster, and I forgot it. But it was not ready for use, and I have to add redux relay-on to make it run properly.

Text Input Error

Text input cannot be inputted, because I forgot the dispatch function while the value changed.

Redux Initial State Array Error

I added an array into Redux with like my_array: [], but while being used in page, it remains undefined.
Now it is OK, but I am not sure why. Maybe because I added some code to check if it is undefined, then dispatch and set its value to [].

Node.js & aws res database

connection to PostgreSQL

The database requires SSH tunnel connection. It is convenient to make a connection pool with Node.js, but the parameters did cost me some time.
It is not OK until I use the configuration of ssl: { rejectUnauthorized: false }. I am not sure if there were any problems, but for development I think it was kind of OK.
There are a lot of modules to be added if the service goes to product.

Related Platforms

(Github Issues) / (Notion) / (Blog)

Advertisement

(A website to optimize your resume and to boost your career: Nonpareil.me)


WordPress

之前的问题:自定义组件不显示

结果是个乌龙,我自己把代码注释掉了,忘记改回来。不过仍然有其它问题,在PHP代码里没有加入redux相关的依赖,修正后可以正常显示。

输入框问题

输入框输入没反应。查了一圈,最后发现是我少写了dispatch。也算是乌龙。

Redux中初始化列表始终是undefined

我在Redux里增加了一个列表参数,用类似 my_array: [] 来初始化,结果在页面中使用时,它始终都是 undefined
现在能够正常使用了,但是我不确定原因。可能是因为我在代码里增加了判断,如果它是 undefined,就再通过dispatch给它赋值成[]。

Node.js & was res 数据库

PostgreSQL数据库连接

数据库要求使用SSH tunnel。用Node.js代码连接不难,但是参数对应花了我不少时间。
最后我增加了 ssl: { rejectUnauthorized: false } 这样一个设置,才终于能够正常连接。这种方式可能会有问题,不过目前作为临时开发还是可以的。
这个服务要真正上线,还得有很多模块添加上去才行。

相关平台

(Github Issues) / (Notion) / (Blog)

推广

(优化简历,助力职场:Nonpareil.me)

发表评论

您的邮箱地址不会被公开。 必填项已用 * 标注

滚动至顶部