当前位置:网站首页>Fe - eggjs combined with typeorm cannot connect to the database
Fe - eggjs combined with typeorm cannot connect to the database
2022-07-02 06:39:00 【Xiao Ming Yuan】
problem
eggjs combination typeorm When packaging and deploying , Consistent error reporting , At first I thought it was eggjs The problem of
[egg-scripts] Got error when startup:
[egg-scripts] at createScript (vm.js:251:10)
[egg-scripts] at Object.runInThisContext (vm.js:303:10)
[egg-scripts] at Module._compile (internal/modules/cjs/loader.js:656:28)
[egg-scripts] at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
[egg-scripts] at Module.load (internal/modules/cjs/loader.js:598:32)
[egg-scripts] at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
[egg-scripts] at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[egg-scripts] at Module.require (internal/modules/cjs/loader.js:636:17)
[egg-scripts] at require (internal/modules/cjs/helpers.js:20:18)
[egg-scripts]
[egg-scripts] pid: 30800
[egg-scripts] hostname: labelnet
[egg-scripts]
[egg-scripts] 2019-03-05 15:17:28,085 ERROR 30796 [-/127.0.0.1/-/1ms GET /] nodejs.SyntaxError: Unexpected token {
[egg-scripts] (function (exports, require, module, __filename, __dirname) { import {
[egg-scripts] ^
[egg-scripts]
[egg-scripts] SyntaxError: Unexpected token {
[egg-scripts] at new Script (vm.js:79:7)
[egg-scripts] at createScript (vm.js:251:10)
[egg-scripts] at Object.runInThisContext (vm.js:303:10)
[egg-scripts] at Module._compile (internal/modules/cjs/loader.js:656:28)
[egg-scripts] at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
[egg-scripts] at Module.load (internal/modules/cjs/loader.js:598:32)
[egg-scripts] at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
[egg-scripts] at Function.Module._load (internal/modules/cjs/loader.js:529:3)
[egg-scripts] at Module.require (internal/modules/cjs/loader.js:636:17)
[egg-scripts] at require (internal/modules/cjs/helpers.js:20:18)
eggjs Of issues Have seen similar problems ,
https://github.com/eggjs/egg/issues/2388
But the official website documents have clearly stated , Load back first js file Post load ts file , I always thought it was eggjs The problem of ;
function npm start Will not load ts
I didn't think so typeorm Configuration problem of ,entity The configuration is ts file , The production environment needs to be configured js file
typeorm It doesn't load automatically entity Of js file
solve
development environment entity load ts file , Production environment load js file
"db_dev": {
"database": "ruisite-dash-server",
"host": "127.0.0.1",
"port": "3306",
"username": "root",
"password": "root",
"logging": true,
"entities": ["app/entity/*.ts", "app/entity/*/*.ts"]
}
"db_production": {
"database": "ruisite-dash-server",
"host": "192.168.100.10",
"port": "3306",
"username": "root",
"password": "root",
"logging": true,
"entities": ["app/entity/*.js", "app/entity/*/*.js"]
}
边栏推荐
- (第一百篇BLOG)写于博士二年级结束-20200818
- apt命令报证书错误 Certificate verification failed: The certificate is NOT trusted
- Function execution space specifier in CUDA
- When requesting resttemplate, set the request header, request parameters, and request body.
- 日志 - 7 - 记录一次丢失文件(A4纸)的重大失误
- 【张三学C语言之】—深入理解数据存储
- QQ email cannot receive the email sent by Jenkins using email extension after construction (timestamp or auth...)
- 20201025 Visual Studio2019 QT5.14 信号和槽功能的使用
- web自动中利用win32上传附件
- CUDA中的异步数据拷贝
猜你喜欢
随机推荐
Loops in tensorrt
Win10:添加或者删除开机启动项,在开机启动项中添加在用户自定义的启动文件
(the 100th blog) written at the end of the second year of doctor's degree -20200818
Render minecraft scenes into real scenes using NVIDIA GPU
CUDA中的函数执行空间说明符
Distributed transactions: the final consistency scheme of reliable messages
CUDA中的Warp Shuffle
一口气说出 6 种实现延时消息的方案
提高用户体验 防御性编程
由於不正常斷電導致的unexpected inconsistency;RUN fsck MANUALLY問題已解决
Mech 3002 explanation
pytest(2) mark功能
sprintf_ How to use s
FE - Eggjs 结合 Typeorm 出现连接不了数据库
web自动化切换窗口时报错“list“ object is not callable
Dynamic global memory allocation and operation in CUDA
代码技巧——Controller参数注解@RequestParam
【每日一题】写一个函数,判断一个字符串是否为另外一个字符串旋转之后的字符串。
Fe - weex uses a simple encapsulated data loading plug-in as the global loading method
Self cultivation of programmers - Reflection on job hunting