React-data-grid: Error: Cannot find module './factoryWithTypeCheckers' from '/home/app/node_modules/react-data-grid-addons/dist'

Created on 13 Jul 2017  路  5Comments  路  Source: adazzle/react-data-grid

HAVE YOU ALREADY SEARCHED FOR SIMILAR ISSUES? PLEASE HELP US OUT AND DOUBLE-CHECK FIRST!
YES
ALSO, PLEASE DON'T BE THAT PERSON WHO DELETES THIS TEMPLATE. IT'S HERE FOR A REASON.

THANKS!

WHICH VERSION OF REACT ARE YOU USING?

Officially Supported:
[ ] v0.14.x
Community Supported:
[x] v15.0.x

WHICH BROWSER ARE YOU USING?

Officially Supported:
[ ] IE 9 / IE 10 / IE 11
[ ] Edge
[x] Chrome
Should work:
[x] Firefox
[x] Safari

I'm submitting a ... (check one with "x")

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/adazzle/react-data-grid/blob/master/CONTRIBUTING.md

Current behavior

>> Error: Cannot find module './factoryWithTypeCheckers' from '/home/app/node_modules/react-data-grid-addons/dist'
Warning: Error running grunt-browserify. Use --force to continue.

Expected/desired behavior

Reproduction of the problem

Environment
Ubuntu Server 16.04.2

  • ESLint Version: v4.2.0

  • Node Version: v6.11.1

  • npm Version: v3.10.10

Using grunt + babel + react for the app on executing grunt build command I get the above error

package.json file

 "devDependencies": {
    "babel-plugin-react-html-attrs": "^2.0.0",
    "babel-plugin-transform-class-properties": "^6.11.5",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-preset-es2015": "^6.14.0",
    "babel-preset-react": "^6.11.1",
    "babelify": "^7.3.0",
    "chai": "^4.1.0",
    "grunt": "^1.0.1",
    "grunt-browserify": "^5.0.0",
    "grunt-contrib-cssmin": "^2.2.0",
    "grunt-contrib-watch": "^1.0.0",
    "mocha": "^3.1.0"
  },
  "dependencies": {
    "bootstrap": "^3.3.7",
    "es6-promise-polyfill": "^1.2.0",
    "eslint": "^4.2.0",
    "eslint-plugin-react": "^7.1.0",
    "faker": "^4.1.0",
    "immutable": "^3.8.1",
    "jquery": "^3.1.0",
    "papaparse": "^4.2.0",
    "prop-types": "^15.5.10",
    "react": "^15.3.1",
    "react-data-grid": "^2.0.53",
    "react-data-grid-addons": "^2.0.53",
    "react-dom": "^15.3.1",
    "react-jsonschema-form": "^0.49.0",
    "react-router": "^2.8.0",
    "react-router-active-component": "^4.0.0",
    "react-share": "^1.10.0"
  }

I have also installed prop-types globally and locally just for the purpose of loading the dependency, but it failed.

What is the expected behavior?
Clean exit. Even after using latest version of Babel and Eslint alongwith Grunt.

What is the motivation / use case for changing the behavior?

Most helpful comment

@acsakshay I had the same issue "Error: Cannot find module './factoryWithTypeCheckers' from '/home/app/node_modules/react-data-grid-addons/dist'" and the issue was resolved when I used
import { Editors, Toolbar, Formatters } from 'react-data-grid-addons/dist/react-data-grid-addons.min.js'; instead of import { Editors, Toolbar, Formatters } from 'react-data-grid-addons';
For some reason both react-data-grid and react-data-grid-addons must be imported with the full path name from node modules.

All 5 comments

@acsakshay I had the same issue "Error: Cannot find module './factoryWithTypeCheckers' from '/home/app/node_modules/react-data-grid-addons/dist'" and the issue was resolved when I used
import { Editors, Toolbar, Formatters } from 'react-data-grid-addons/dist/react-data-grid-addons.min.js'; instead of import { Editors, Toolbar, Formatters } from 'react-data-grid-addons';
For some reason both react-data-grid and react-data-grid-addons must be imported with the full path name from node modules.

@vamshikeesara Thank you for your reply. Eventually I had to opt for another data grid. But definitely this will help someone in future. Thanks.

This just saved my caboose, thanks!

I encountered this same issue when attempting to build with browserify.

I had the same issue, when I just required react-data-grid. Requiring react-data-grid/dist/react-data-grid.min.js instead resolved this issue.

Was this page helpful?
0 / 5 - 0 ratings