Coder Social home page Coder Social logo

bundle-helper's People

Contributors

czy88840616 avatar nawbc avatar weiyunpeng avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

nawbc weiyunpeng

bundle-helper's Issues

throw new ERR_INVALID_ARG_TYPE(name, 'string', value)

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报错

根据官方文档引入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"
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.