michalsnik / aos

Animate on scroll library
MIT License
26.94k stars 2.6k forks source link

Webpack failed to comple #178

Closed cshold closed 7 years ago

cshold commented 7 years ago

npm install worked fine, but when running npm run dev I get this error:

 http://localhost:8080/webpack-dev-server/
webpack result is served from /dist/
content is served from demo/
Hash: 8a9278811ce33c728007
Version: webpack 1.15.0
Time: 1156ms
     Asset     Size  Chunks             Chunk Names
    aos.js  14.3 kB       0  [emitted]  main
aos.js.map   110 kB       0  [emitted]  main
chunk    {0} aos.js, aos.js.map (main) 44.4 kB [rendered]
    [0] ./src/js/aos.js 7.43 kB {0} [built] [1 error]
    [1] ./~/lodash.throttle/index.js 13.8 kB {0} [built]
    [2] ./~/lodash.debounce/index.js 11.3 kB {0} [built]
    [3] ./src/js/libs/observer.js 1.38 kB {0} [built]
    [4] ./src/js/helpers/detector.js 5.49 kB {0} [built]
    [5] ./src/js/helpers/handleScroll.js 1.14 kB {0} [built]
    [6] ./src/js/helpers/prepare.js 586 bytes {0} [built]
    [7] ./src/js/helpers/calculateOffset.js 2.16 kB {0} [built]
    [8] ./src/js/libs/offset.js 608 bytes {0} [built]
    [9] ./src/js/helpers/elements.js 567 bytes {0} [built]

ERROR in ./src/js/aos.js
Module not found: Error: Cannot resolve module 'postcss-loader' in /Projects/aos/src/js
 @ ./src/js/aos.js 13:11-40
webpack: Failed to compile.

For what it's worth, npm test runs and everything passes.

lmuzquiz commented 7 years ago

I get the same error. My node version is 8.1.3 and my npm version is 5.0.4 I have a feeling that the whole problem is that we are using a newer version of node than the one he used. Im going to try on node 6 to see what happens.

lmuzquiz commented 7 years ago

Switched to Node 6.11.0 and after npm i -D postcss-loader and running webpack run dev i get more errors:

ERROR in ./~/css-loader?sourceMap!./~/sass-loader!./~/postcss-loader/lib!./src/sass/aos.scss
    Module build failed: Error: No PostCSS Config found in: /Users/lmuzquiz/Web/aos/src/sass
        at Error (native)
        at /Users/lmuzquiz/Web/aos/node_modules/postcss-load-config/index.js:51:26
michalsnik commented 7 years ago

Hey guys, thanks for catching this! Try now. Turned out one of the latest thing merged regarding autoprefixer caused some troubles and I wasn't digging in it recently so it went unnoticed.. It should work on Node 8 too.

lmuzquiz commented 7 years ago

Yes now it works on Node 8