Skip to content

TypeError: Cannot read property 'hash' of undefined #416

Open
scalableminds/webknossos
#3239
@pustovalov

Description

@pustovalov

Expected Behavior

Successful compilation from the first time

Actual Behavior

The first compilation failed, the second successful

Is an error being thrown?

debug:

function updateMd5CacheItem(value) {
  if (md5Cache[file]) {
    console.log('file', file)
    console.log('md5Cache[file]', md5Cache[file])
    console.log('value', value)
  }
  if (
    !md5Cache[file] ||
    (md5Cache[file] && md5Cache[file].hash !== value.hash)
  ) {

log:

file /app/assets/stylesheets/themes/shared/_flex.scss
md5Cache[file] { mtime: 1533291733713,
  hash: 'a57c36d6619fa2b99458d0f2d4045d74',
  isFile: true,
  isDirectory: false }
value { mtime: 1533291735643,
  hash: 'a57c36d6619fa2b99458d0f2d4045d74',
  isFile: true,
  isDirectory: false }
file /vendor/assets/stylesheets/_spaces.sass
md5Cache[file] { mtime: 1533291734298,
  hash: '24f5e6afc9adbd8007d9bb8aaf881ddb',
  isFile: true,
  isDirectory: false }
value { mtime: 1533291735643,
  hash: '24f5e6afc9adbd8007d9bb8aaf881ddb',
  isFile: true,
  isDirectory: false }
file /app/assets/stylesheets/application_v2/_config.sass
md5Cache[file] { mtime: 1533291733710,
  hash: '70d356e279b46ee8dc81ab0173772507',
  isFile: true,
  isDirectory: false }
value undefined
file /app/assets/stylesheets/themes/shared/_utils.sass
md5Cache[file] { mtime: 1533291733712,
  hash: 'b151941279dbf615b1cc28bfcded8f38',
  isFile: true,
  isDirectory: false }
value undefined
TypeError: Cannot read property 'hash' of undefined
    at updateMd5CacheItem (/node_modules/hard-source-webpack-plugin/lib/CacheMd5.js:373:66)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Steps to Reproduce

just run webpack-dev-server

Operating System, Node, and NPM dependency versions

Mac OS 10.13.6
Node 10.7.0
webpack: 3.12.0
hard-source-webpack-plugin 0.12.0

"dependencies": {
  "@rails/webpacker": "3.5",
  "at.js": "^1.5.3",
  "autoprefixer": "^8.x",
  "babel-plugin-dynamic-import-webpack": "^1.0.2",
  "babel-plugin-styled-components": "^1.5.1",
  "babel-plugin-transform-decorators-legacy": "^1.3.4",
  "babel-plugin-transform-do-expressions": "^6.22.0",
  "babel-polyfill": "^6.26.0",
  "babel-preset-env": "^1.6.0",
  "babel-preset-react": "^6.24.1",
  "babel-preset-stage-2": "^6.24.1",
  "balloon-css": "^0.5.0",
  "caniuse-lite": "^1.0.30000697",
  "cjsx-loader": "^3.0.0",
  "classnames": "^2.2.5",
  "clipboard": "^2.0.1",
  "coffee-loader": "^0.9.0",
  "coffeescript": "^2.3.1",
  "compression-webpack-plugin": "^1.0.0",
  "create-react-class": "^15.6.3",
  "dropzone": "^5.3.0",
  "expose-loader": "^0.7.3",
  "filesize": "^3.6.1",
  "glob": "^7.1.2",
  "highcharts": "^6.0.4",
  "highlight.js": "9.12.0",
  "jquery": "^1.12.3",
  "jquery.caret": "^0.3.1",
  "js-yaml": "^3.9.1",
  "lodash": "^4.17.10",
  "mobx": "^4.3.1",
  "mobx-devtools-mst": "^0.9.18",
  "mobx-react": "^5.2.3",
  "mobx-react-form": "^1.32.2",
  "mobx-react-form-devtools": "^1.7.2",
  "mobx-state-tree": "^2.2.0",
  "moment-timezone": "^0.5.14",
  "node-sass": "^4.8.3",
  "path-complete-extname": "^0.1.0",
  "pluralize": "^7.0.0",
  "postcss-smart-import": "^0.7.5",
  "precss": "^2.0.0",
  "prop-types": "^15.6.0",
  "query-string": "^5.1.0",
  "rails-erb-loader": "^5.4.2",
  "react": "^16.2.0",
  "react-bootstrap": "0.31.5",
  "react-dom": "^16.2.0",
  "react-helmet": "^5.2.0",
  "react-loadable": "^5.3.1",
  "react-router-dom": "^4.3.1",
  "react-router-navigation-prompt": "^1.5.5",
  "react-scroll": "^1.7.9",
  "react-simple-colorpicker": "^1.x",
  "react-textarea-autosize": "^6.1.0",
  "resolve-url-loader": "^2.1.0",
  "sass-loader": "^7.0.3",
  "sortablejs": "^1.7.0",
  "stickyfilljs": "^2.0.3",
  "styled-components": "3.2.6",
  "stylelint": "^8.3.0",
  "stylelint-config-standard": "^18.0.0"
},
"devDependencies": {
  "babel-eslint": "^8.2.3",
  "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
  "enzyme": "^3.3.0",
  "enzyme-adapter-react-16": "^1.1.1",
  "eslint": "^4.19.1",
  "eslint-config-standard": "^10.2.1",
  "eslint-config-standard-react": "^5.0.0",
  "eslint-plugin-babel": "^4.1.2",
  "eslint-plugin-import": "^2.7.0",
  "eslint-plugin-node": "^5.1.1",
  "eslint-plugin-promise": "^3.5.0",
  "eslint-plugin-react": "^7.3.0",
  "eslint-plugin-standard": "^3.0.1",
  "hard-source-webpack-plugin": "^0.12.0",
  "jest": "^23.2.0",
  "jest-enzyme": "^6.0.2",
  "jest-html": "^1.4.0",
  "jest-serializer-enzyme": "^1.0.0",
  "jest-serializer-html": "^5.0.0",
  "jest-styled-components": "^5.0.1",
  "mobx-devtools-mst": "^0.9.18",
  "prettier": "^1.7.4",
  "webpack-bundle-analyzer": "^2.10.0",
  "webpack-dev-server": "2.11.2"
},

plugin configuration:

const HardSourceWebpackPlugin = require('hard-source-webpack-plugin')
environment.plugins.prepend('HardSourceWebpackPlugin',
  new HardSourceWebpackPlugin()
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions