Comments (4)
请先升级到最新版的 ykit 试试
from ykit.
/Users/lishuai/bee/test/ykit.js:8
this.applymiddleware(proxy)
^
TypeError: this.applymiddleware is not a function
at Object.modifyWebpackConfig (/Users/lishuai/bee/test/ykit.js:8:12)
at Config.setCompiler (/Users/lishuai/.nvm/versions/node/v7.9.0/lib/node_modules/ykit/lib/models/Config.js:161:64)
at Project.handleExportsConfig (/Users/lishuai/.nvm/versions/node/v7.9.0/lib/node_modules/ykit/lib/models/Project.js:351:29)
at Project.readConfig (/Users/lishuai/.nvm/versions/node/v7.9.0/lib/node_modules/ykit/lib/models/Project.js:253:47)
at new Project (/Users/lishuai/.nvm/versions/node/v7.9.0/lib/node_modules/ykit/lib/models/Project.js:76:14)
at Object.exports.getProject (/Users/lishuai/.nvm/versions/node/v7.9.0/lib/node_modules/ykit/lib/modules/manager.js:93:29)
at Object.run (/Users/lishuai/.nvm/versions/node/v7.9.0/lib/node_modules/ykit/lib/cli.js:67:31)
at Object. (/Users/lishuai/.nvm/versions/node/v7.9.0/lib/node_modules/ykit/bin/ykit:8:5)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
➜ test ykit -v
[ykit] 0.8.3-beta.0
最新的也不行,最初我就在最新上尝试,然后有问题,还以为是新版本有问题,切到老版本也有此问题.
另外ykit的配置如下:
var proxy = require('bee-proxy')
var path = require('path');
module.exports = {
config: {
exports: ['./scripts/app.js'],
modifyWebpackConfig: function (baseConfig) {
// 示例:处理 .hello 类型文件,全部返回文字 "hello!"
this.applymiddleware(proxy)
return baseConfig;
}
}
};
几乎都是ykit init出来的工程,我就尝试加下中间件,然后就发现报错了.
请问你本地没有问题么,还是我电脑的环境问题?
from ykit.
找到原因了,是你们官网的示例错了.https://ykit.ymfe.org/guide/advanced-guides.html
这个页面的this.applymiddleware 都应该写成 this.applyMiddleware. 官方文档中示例错误,真的是不走心呀.
from ykit.
感谢反馈。
from ykit.
Related Issues (20)
- ykit关于发布到production环境react报错的问题 HOT 1
- 在使用ykit server时报错 HOT 1
- 好像发现一个地方写错了 HOT 1
- windows上各种不行 HOT 3
- path.js:39 throw new ERR_INVALID_ARG_TYPE('path', 'string', path); HOT 4
- Yii 已存在的接口:/company/index.php[GET],添加不了
- 前端页面二次开发疑问 HOT 1
- 关于YAPI启动开发环境和测试环境的区别疑问 HOT 2
- 使用ykit s -p 功能无法启动server HOT 2
- 什么时候支持 webpack4 HOT 1
- https://ykit.ymfe.org/已挂 HOT 1
- 使用ykit init vue生成的项目控制台会直接报错
- 请教关于Yapi第三方插件登录失败的问题 HOT 1
- 如何配置类似 webpack-dev-server 的 proxy
- 请教关于设置代理解决跨域的问题 HOT 2
- 莫名其妙的就不行了 HOT 1
- 在node16下,启动后,不会检测文件变化自动编译。
- Ola
- ykit pack -m打包时总说找不到fs\net\tls模块 HOT 4
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 ykit.