我试着在Symfony中使用Encore。
第一个例子
我执行命令:
./node_modules/.bin/encore dev这还我的错误:
path.js:7
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.join (path.js:1211:7)
at find (/www/testencore/node_modules/babel-loader/lib/resolve-rc.js:11:21)
at module.exports (/www/testencore/node_modules/@symfony/webpack-encore/lib/config/parse-runtime.js:64:47)
at Object.<anonymous> (/www/testencore/node_modules/@symfony/webpack-encore/bin/encore.js:18:23)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)发布于 2017-06-20 13:52:40
你的问题与巴贝尔-装载机的7.1版本有关。(cfr.https://github.com/symfony/webpack-encore/issues/40)
可以通过在package.json中添加以下行来解决此问题
"babel-loader": "7.0"在这之后,确保运行yarn upgrade,webpack-encore应该会再次工作.
请注意,这是一个临时修复。您应该密切关注github问题,看看是否有永久的修复程序可用。
编辑:-这已经修复自Encore 0.9.1,更新应该解决问题。
https://stackoverflow.com/questions/44653875
复制相似问题