akanix42 / meteor-css-modules

MIT License
92 stars 20 forks source link

Error with less package in node_modules #77

Closed StGeass closed 7 years ago

StGeass commented 7 years ago

When i try start project with installed Less package, i got this error:

/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Processing Step: CSS Modules / PostCSS compilation
Unable to compile /path-to-project/node_modules/less/test/css/debug/linenumbers-all.css
CssSyntaxError: /path-to-project/node_modules/less/test/css/debug/linenumbers-all.css:3:57: Unknown word
/* line 1, {pathimport}test.less */
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000031}}
                                                        ^
/* @charset "ISO-8859-1"; */

/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=> Errors prevented startup:                  

   While processing files with stgeass:css-modules (for target web.browser):
   error: /path-to-project/node_modules/less/test/css/debug/linenumbers-all.css:3:57: Unknown word

   While minifying app stylesheet:
   app/node_modules/less/test/css/compression/compression.css.css:3:164: @page missing '}'
   path.js:8:11: Path must be a string. Received null
   at assertPath (path.js:8:11)
   at Object.posix.relative (path.js:496:3)
   at pathRelative (packages/minifier-css.js:449:30)
   at packages/minifier-css.js:408:31
   at Array.forEach (native)
   at Function._.each._.forEach (packages/underscore.js:139:11)
   at packages/minifier-css.js:365:7
   at Array.forEach (native)
   at Function._.each._.forEach (packages/underscore.js:139:11)
   at rewriteRules (packages/minifier-css.js:342:5)
   at Object.CssTools.rewriteCssUrls (packages/minifier-css.js:328:5)
   at packages/minifier-css.js:298:16
   at Array.forEach (native)
   at Function._.each._.forEach (packages/underscore.js:139:11)
   at Object.CssTools.mergeCssAsts (packages/minifier-css.js:275:7)
   at packages/minifyStdCSS_plugin.js:113:31
   at CssToolsMinifier.processFilesForBundle (packages/minifyStdCSS_plugin.js:33:16)
StGeass commented 7 years ago

Or i should add node_modules to ignorePaths?

akanix42 commented 7 years ago

Yes, add either node_modules or node_modules/less to the ignorePaths. This is an unfortunate restriction due to the way Meteor processes files (it pulls in every file with that extension regardless of whether it's used in the project).