Akryum / Akryum/packt-vue-project-guide

Chapter 5 stylus-loader issue

未关闭
#9 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
41
派生
35
PR 合并指标
30 天内没有已合并 PR

描述

I'm leaving a comment here in case anyone else comes across this issue. When working through the setup portion of Chapter 5, if you follow the instructions as written you'll get an error when trying to load stylus in components later on in the chapter, which will cause your app not to boot up. I'm not 100% sure of the cause, but suspect it has to do with changes in more recent versions of stylus-loader. This can be fixed by rolling back to the versions of stylus and stylus-loader that were used when the book was written.

**The fix that worked for me:**
- If you've already run `npm install`, delete your `package-lock.json` file and your `node_modules` folder
- In this repo go to 'chapter5-full' and copy the contents of the `package.json` file
- Paste the contents into the `package.json` file of your app
- Run `npm install` and `npm run dev` again and everything should be working

For reference, here's the error message I was getting in Terminal:
`(node:49850) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:49850) UnhandledPromiseRejectionWarning: TypeError: loaderContext.getResolve is not a function
at createEvaluator (/Users/chrisgustin/Desktop/study/chapter-5/support-center/node_modules/stylus-loader/dist/utils.js:276:37)
at Object.stylusLoader (/Users/chrisgustin/Desktop/study/chapter-5/support-center/node_modules/stylus-loader/dist/index.js:107:60)
at LOADER_EXECUTION (/Users/chrisgustin/Desktop/study/chapter-5/support-center/node_modules/loader-runner/lib/LoaderRunner.js:119:14)
at runSyncOrAsync (/Users/chrisgustin/Desktop/study/chapter-5/support-center/node_modules/loader-runner/lib/LoaderRunner.js:120:4)
at iterateNormalLoaders (/Users/chrisgustin/Desktop/study/chapter-5/support-center/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
at iterateNormalLoaders (/Users/chrisgustin/Desktop/study/chapter-5/support-center/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
at /Users/chrisgustin/Desktop/study/chapter-5/support-center/node_modules/loader-runner/lib/LoaderRunner.js:236:3
at Object.context.callback (/Users/chrisgustin/Desktop/study/chapter-5/support-center/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Object.module.exports (/Users/chrisgustin/Desktop/study/chapter-5/support-center/node_modules/vue-loader/lib/selector.js:21:8)
at LOADER_EXECUTION (/Users/chrisgustin/Desktop/study/chapter-5/support-center/node_modules/loader-runner/lib/LoaderRunner.js:119:14)
(node:49850) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)`

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。