javascript-development-environment icon indicating copy to clipboard operation
javascript-development-environment copied to clipboard

Error: The style-loader cannot be used in a non-browser environment

Open splashcd opened this issue 8 years ago • 2 comments
trafficstars

Hi Cory, after resolving the previous command by comparing/contrasting code from your final project code, I am now receiving this error. Have you come across it before?

> npm run start

> [email protected] prestart /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env
> babel-node buildScripts/startMessage.js

Starting app in dev mode...

> [email protected] start /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env
> npm-run-all --parallel security-check lint:watch open:src


> [email protected] security-check /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env
> nsp check


> [email protected] lint:watch /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env
> npm run lint -- --watch


> [email protected] open:src /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env
> babel-node buildScripts/srcServer.js


> [email protected] lint /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env
> esw webpack.config.* src buildScripts --color "--watch"

(+) No known vulnerabilities found
✓ Clean (8:09:08 PM)
Hash: bac25d0a7ccc9b2c43c3
Version: webpack 1.13.2
Time: 841ms
     Asset     Size  Chunks             Chunk Names
 bundle.js  95.3 kB       0  [emitted]  main
index.html  1.09 kB          [emitted]
chunk    {0} bundle.js (main) 34.1 kB [rendered]
    [0] multi main 28 bytes {0} [built]
    [1] ./src/index.js 395 bytes {0} [built]
    [2] ./src/index.css 907 bytes {0} [built]
    [3] ./~/css-loader!./src/index.css 229 bytes {0} [built]
    [4] ./~/css-loader/lib/css-base.js 1.51 kB {0} [built]
    [5] ./~/style-loader/addStyles.js 7.15 kB {0} [built]
    [6] ./~/numeral/numeral.js 23.9 kB {0} [built]

ERROR in   Error: The style-loader cannot be used in a non-browser environment

  - index.js:185 module.exports
    /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env/src/index.js:185:43

  - index.js:71 Object.<anonymous>
    /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env/src/index.js:71:37

  - index.js:21 __webpack_require__
    /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env/src/index.js:21:30

  - index.js:50 Object.<anonymous>
    /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env/src/index.js:50:2

  - index.js:21 __webpack_require__
    /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env/src/index.js:21:30

  - index.js:41
    /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env/src/index.js:41:18

  - index.js:44
    /Users/bxberry/dev/js-dev-env/pluralsight-js-dev-env/src/index.js:44:10

  - index.js:225 HtmlWebpackPlugin.evaluateCompilationResult
    [pluralsight-js-dev-env]/[html-webpack-plugin]/index.js:225:26

  - index.js:115
    [pluralsight-js-dev-env]/[html-webpack-plugin]/index.js:115:21


Child html-webpack-plugin for "index.html":
         Asset     Size  Chunks       Chunk Names
    index.html  36.9 kB       0
    chunk    {0} index.html 34.1 kB [rendered]
        [0] ./~/html-webpack-plugin/lib/loader.js!./src/index.js 395 bytes {0} [built]
        [1] ./src/index.css 907 bytes {0} [built]
        [2] ./~/css-loader!./src/index.css 229 bytes {0} [built]
        [3] ./~/css-loader/lib/css-base.js 1.51 kB {0} [built]
        [4] ./~/style-loader/addStyles.js 7.15 kB {0} [built]
        [5] ./~/numeral/numeral.js 23.9 kB {0} [built]

splashcd avatar Mar 01 '17 14:03 splashcd

I haven't seen that. This doesn't occur in the final course exercise so I'd diff your solution with that.

coryhouse avatar Mar 01 '17 14:03 coryhouse

Did you find what is causing this?

BrsJsk avatar Apr 22 '18 11:04 BrsJsk