Akryum / Akryum/packt-vue-project-guide

Chapter 5 stylus-loader issue

Aberta
#9 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
JavaScript
Estrelas
41
Forks
35
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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)`

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.