akanix42 / meteor-css-modules

MIT License
92 stars 19 forks source link

TypeError: Cannot read property 'render' of null (Usage With Stylus) #94

Closed seunlanlege closed 7 years ago

seunlanlege commented 7 years ago

Hi @nathantreid thanks for this great package, it works well with css, but when i tried to use it with stylus i keep getting this error.

[[[[[ ~/seun:peer-donation ]]]]]
=> Started proxy.`                     
   Building for web.browser                  /
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Processing Step: Stylus compilation
Unable to compile /home/seunlanlege/seun:peer-donation/client/styl/index.styl
Line: NaN, Column: undefined
TypeError: Cannot read property 'render' of null

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

   While processing files with nathantreid:css-modules (for target web.browser):
   packages/mss/stylus-processor.js:73:5: Cannot read property 'render' of null
   at StylusProcessor._transpile (packages/mss/stylus-processor.js:73:5)
   at StylusProcessor._process (packages/mss/stylus-processor.js:58:37)
   at StylusProcessor.process (packages/mss/stylus-processor.js:41:12)
   at CssModulesBuildPlugin._preprocessFile
   (packages/mss/css-modules-build-plugin.js:257:30)
   at CssModulesBuildPlugin.compileOneFile (packages/mss/css-modules-build-plugin.js:141:10)
   at packages/caching-compiler/multi-file-caching-compiler.js:115:45
   at packages/caching-compiler/multi-file-caching-compiler.js:97:11
   at
   /home/seunlanlege/.meteor/packages/nathantreid_css-modules/.2.5.1.r1f5b6++os+web.browser+web.cordova/plugin.mss.os/npm/node_modules/meteor/caching-compiler/node_modules/async/lib/async.js:182:20
   at replenish
   (/home/seunlanlege/.meteor/packages/nathantreid_css-modules/.2.5.1.r1f5b6++os+web.browser+web.cordova/plugin.mss.os/npm/node_modules/meteor/caching-compiler/node_modules/async/lib/async.js:317:21)
   at
   /home/seunlanlege/.meteor/packages/nathantreid_css-modules/.2.5.1.r1f5b6++os+web.browser+web.cordova/plugin.mss.os/npm/node_modules/meteor/caching-compiler/node_modules/async/lib/async.js:328:15
   at Object.async.forEachLimit.async.eachLimit
   (/home/seunlanlege/.meteor/packages/nathantreid_css-modules/.2.5.1.r1f5b6++os+web.browser+web.cordova/plugin.mss.os/npm/node_modules/meteor/caching-compiler/node_modules/async/lib/async.js:221:35)
   at CssModulesBuildPlugin.processFilesForTarget
   (packages/caching-compiler/multi-file-caching-compiler.js:95:11)
   at CssModulesBuildPlugin.processFilesForTarget
   (packages/mss/css-modules-build-plugin.js:58:5)

=> Your application has errors. Waiting for file change.
=> Started MongoDB.

and here's my package.json

  "name": "test",
  "version": "1.0.0",
  "description": "",
  "author": "",
  "dependencies": {
    "babel-runtime": "6.18.0",
    "meteor-node-stubs": "~0.2.0",
    "mobx": "^3.1.7",
    "mobx-react": "^4.1.3",
    "react": "^15.4.2",
    "react-dom": "^15.4.2",
    "react-mounter": "^1.2.0"
  },
  "devDependencies": {
    "autoprefixer": "^6.5.1",
    "babel-eslint": "^7.2.0",
    "babel-plugin-transform-class-properties": "^6.23.0",
    "eslint": "^3.18.0",
    "eslint-config-standard": "^7.1.0",
    "eslint-config-standard-react": "^4.3.0",
    "eslint-import-resolver-meteor": "^0.3.4",
    "eslint-plugin-import": "^2.2.0",
    "eslint-plugin-meteor": "^4.0.1",
    "eslint-plugin-promise": "^3.5.0",
    "eslint-plugin-react": "^6.10.3",
    "eslint-plugin-react-app": "^1.0.2",
    "eslint-plugin-standard": "^2.1.1",
    "postcss-import": "^8.1.2",
    "postcss-modules-extract-imports": "1.0.0",
    "postcss-modules-local-by-default": "1.0.0",
    "postcss-modules-scope": "1.0.0",
    "postcss-modules-values": "1.1.1",
    "postcss-nested": "1.0.0",
    "postcss-scss": "^0.3.1",
    "postcss-simple-vars": "1.1.0",
    "rucksack-css": "^0.8.6",
    "stylus": "^0.54.5"
  },
  "cssModules": {
    "ignorePaths": [
      "node_modules"
    ],
    "specificArchitecture": false,
    "extensions": [
      "styl"
    ],
    "enableStylusCompilation": [
      "styl"
    ],
    "postcssPlugins": {
      "postcss-import": {},
      "postcss-simple-vars": {},
      "postcss-modules-values": {},
      "postcss-nested": {},
      "postcss-modules-local-by-default": {},
      "postcss-modules-extract-imports": {},
      "postcss-modules-scope": {},
      "rucksack-css": {},
      "autoprefixer": {
        "browsers": [
          "last 2 versions"
        ]
      }
    }
  },
  "eslintConfig": {
    "parser": "babel-eslint",
    "parserOptions": {
      "allowImportExportEverywhere": true,
      "ecmaVersion": 6,
      "ecmaFeatures": {
        "jsx": true
      },
      "sourceType": "module"
    },
    "plugins": [
      "meteor",
      "react"
    ],
    "env": {
      "browser": true,
      "node": true,
      "es6": false
    },
    "ecmaFeatures": {
      "modules": true
    },
    "extends": [
      "standard",
      "standard-react",
      "plugin:meteor/recommended",
      "plugin:react-app/recommended",
      "plugin:import/errors",
      "plugin:import/warnings"
    ],
    "rules": {
      "experimentalDecorators": 0
    },
    "settings": {
      "import/resolver": {
        "meteor": {
          "extensions": [
            ".jsx",
            ".js"
          ]
        }
      },
      "import/core-modules": [
        "meteor/meteor"
      ],
      "import/no-extraneous-dependencies": "off"
    }
  }
}
akanix42 commented 7 years ago

Thanks for the report - this has been in fixed in v2.5.3.