midwayjs / bundle-helper Goto Github PK
View Code? Open in Web Editor NEWmidway bundle helper
midway bundle helper
node:internal/validators:120
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:372:5)
at validateString (node:internal/validators:120:11)
at relative (node:path:497:5)
at \node_modules@midwayjs\bundle-helper\dist\index.js:99:66
at Array.filter ()
at EntryGenerator.run (\node_modules@midwayjs\bundle-helper\dist\index.js:99:14)
at Object. (\node_modules@midwayjs\bundle-helper\bin\bundle.js:13:11)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
code: 'ERR_INVALID_ARG_TYPE'
}
根据官方文档引入sequelize,经过排查发现在模型定义时使用装饰器 @Table
,运行bundle报错(系统环境Windows 11),
尝试调整为 @Table({})
,可以正常bundle。
我参考的 midway sequelize文档链接
运行bundle时的结果和报错信息如下:
* 正在执行任务: pnpm run bundle_index
> midway-quick-start@1.0.0 bundle_index D:\Projects\my-midway-test
> bundle && npm run build && ncc build bootstrap.js -o build
D:\Projects\my-midway-test\node_modules\.pnpm\registry.npmmirror.com+@midwayjs+bundle-helper@1.2.0\node_modules\@midwayjs\bundle-helper\dist\index.js:72
if (symbol.getName() === 'Configuration') {
^
TypeError: Cannot read properties of undefined (reading 'getName')
at D:\Projects\my-midway-test\node_modules\.pnpm\registry.npmmirror.com+@midwayjs+bundle-helper@1.2.0\node_modules\@midwayjs\bundle-helper\dist\index.js:72:28
at Array.forEach (<anonymous>)
at EntryGenerator.visit (D:\Projects\my-midway-test\node_modules\.pnpm\registry.npmmirror.com+@midwayjs+bundle-helper@1.2.0\node_modules\@midwayjs\bundle-helper\dist\index.js:70:80)
at D:\Projects\my-midway-test\node_modules\.pnpm\registry.npmmirror.com+@midwayjs+bundle-helper@1.2.0\node_modules\@midwayjs\bundle-helper\dist\index.js:99:72
at visitNodes (D:\Projects\my-midway-test\node_modules\.pnpm\registry.npmmirror.com+typescript@4.8.4\node_modules\typescript\lib\typescript.js:31095:30)
at Object.forEachChild (D:\Projects\my-midway-test\node_modules\.pnpm\registry.npmmirror.com+typescript@4.8.4\node_modules\typescript\lib\typescript.js:31423:24)
at EntryGenerator.collect (D:\Projects\my-midway-test\node_modules\.pnpm\registry.npmmirror.com+@midwayjs+bundle-helper@1.2.0\node_modules\@midwayjs\bundle-helper\dist\index.js:99:16)
at EntryGenerator.run (D:\Projects\my-midway-test\node_modules\.pnpm\registry.npmmirror.com+@midwayjs+bundle-helper@1.2.0\node_modules\@midwayjs\bundle-helper\dist\index.js:105:31)
at Object.<anonymous> (D:\Projects\my-midway-test\node_modules\.pnpm\registry.npmmirror.com+@midwayjs+bundle-helper@1.2.0\node_modules\@midwayjs\bundle-helper\bin\bundle.js:13:11)
at Module._compile (node:internal/modules/cjs/loader:1191:14)
ELIFECYCLE Command failed with exit code 1.
* 终端进程“C:\Windows\System32\cmd.exe /d /c pnpm run bundle_index”已终止,退出代码: 1。
* 终端将被任务重用,按任意键关闭。
相关依赖版本:
"dependencies": {
"@midwayjs/sequelize": "3",
"mysql2": "^3.2.0",
"sequelize": "^6.30.0",
"sequelize-typescript": "^2.1.5"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.