榆树早午餐编译问题:“拆分”未定义
Elm-Brunch compiling issue: 'split' of undefined
我的Elm代码(https://github.com/puruzio/seat_saver)在Elm Reactor中运行良好,并且使用elm-make编译良好,但是当我通过早午餐编译它时,我收到以下错误。这并没有给我太多关于在哪里修复错误的线索。
My-MacBook-Pro:seat_saver_old puruzio$ brunch build
Elm compile: Main.elm, in web/elm, to ../static/vendor/main.js
[BABEL] Note: The code generator has deoptimised the styling of "web/elm/app.js" as it exceeds the max of "100KB".
[BABEL] Note: The code generator has deoptimised the styling of "web/elm/elm.js" as it exceeds the max of "100KB".
05 Mar 16:16:51 - info: compiling
05 Mar 16:16:54 - error: [TypeError: Cannot read property 'split' of undefined]
我的项目基于此处找到的示例 http://www.cultivatehq.com/posts/phoenix-elm-10/我尝试在单独的文件中添加多个模块。
早午餐配置.js
exports.config = {
// See http://brunch.io/#documentation for docs.
files: {
javascripts: {
joinTo: "js/app.js"
},
stylesheets: {
joinTo: "css/app.css"
},
templates: {
joinTo: "js/app.js"
}
},
conventions: {
assets: /^(web'/static'/assets)/
},
// Phoenix paths configuration
paths: {
// Dependencies and current project directories to watch
watched: [
"deps/phoenix/web/static",
"deps/phoenix_html/web/static",
"web/static",
"test/static",
"web/elm"
],
// Where to compile files to
public: "priv/static"
},
// Configure your plugins
plugins: {
babel: {
// Do not use ES6 compiler in vendor code
ignore: [/web'/static'/vendor/]
},
elmBrunch: { //<<<<<<<< Here is the elmBrunch configuration
elmFolder: 'web/elm',
mainModules: ['Main.elm'],
outputFolder: '../static/vendor'
}
} ,
modules: {
autoRequire: {
"js/app.js": ["web/static/js/app"]
}
},
npm: {
enabled: true
}
};
您可以在早
午餐配置中的插件 - babel 部分添加以下内容.js
compact: false
即
plugins: {
babel: {
// Do not use ES6 compiler in vendor code
ignore: [/web'/static'/vendor/],
compact: false
},
elmBrunch: { //<<<<<<<< Here is the elmBrunch configuration
...
}
}
相关文章:
- 为什么“;未定义的“;在JavaScript中结束循环
- 要求未定义JS回调参数
- 如何检查管道中未定义的项目
- TypeError:无法读取属性'推'未定义的JavaScript
- $window.ga在AngularJS事件中未定义
- 未捕获的TypeError无法读取未定义的属性socialsharing
- 换行符拆分返回“”;未定义”;
- 拆分字符串数组(JavaScript)后未定义
- 未捕获的类型错误:无法读取属性'拆分'的未定义
- 未捕获的类型错误:无法读取属性'拆分'的未定义(匿名函数)
- 无法读取属性'拆分'的未定义
- 榆树早午餐编译问题:“拆分”未定义
- 将字符串拆分为两个变量 - 未定义不是一个函数
- JavaScript 使用 setTimeout 遍历数组运行到未定义的拆分中
- 在regex拆分过程中会出现javascript未定义元素
- 0x800a138f-JavaScript运行时错误:无法获取属性'拆分'的未定义引用或null引用
- 未捕获的类型错误:无法读取属性'拆分'的未定义
- Javascript拆分未定义数组
- jQuery UI 选项卡 - 未捕获类型错误:无法调用未定义的方法“拆分”
- 将JSON拆分为两个数组会得到未定义的键值