TypeError: Cannot read property 'string' of undefined by using griddle 1.0.3 and react 16.2.0

251 views Asked by At

I am trying to use griddle-react 1.0.3 with react 16.2.0 but getting the following error "Typeerror: Cannot read property 'string' of undefined". How to resolve this error? Shall I use griddle 0.8.1 for react 16.2.0 or is this the right cimbination which I am using?

W20181002-15:38:55.733(5)? (STDERR) TypeError: Cannot read property 'string' 
of undefined
W20181002-15:38:55.734(5)? (STDERR)     at Object.<anonymous> 
(D:\react_projects\backstage-check\node_modules\griddle- 
react\dist\module\components\ColumnDefinition.js:42:33)
W20181002-15:38:55.735(5)? (STDERR)     at Module._compile 
(module.js:652:30)
W20181002-15:38:55.735(5)? (STDERR)     at Object.Module._extensions..js 
(module.js:663:10)
W20181002-15:38:55.736(5)? (STDERR)     at Module.load (module.js:565:32)
W20181002-15:38:55.737(5)? (STDERR)     at tryModuleLoad (module.js:505:12)
W20181002-15:38:55.738(5)? (STDERR)     at Function.Module._load 
(module.js:497:3)
W20181002-15:38:55.738(5)? (STDERR)     at Module.require (module.js:596:17)
W20181002-15:38:55.739(5)? (STDERR)     at require 
(internal/module.js:11:18)
W20181002-15:38:55.740(5)? (STDERR)     at Object.<anonymous> 
(D:\react_projects\backstage-check\node_modules\griddle- 
react\dist\module\components\index.js:15:25)
W20181002-15:38:55.741(5)? (STDERR)     at Module._compile 
(module.js:652:30)
W20181002-15:38:55.741(5)? (STDERR)     at Object.Module._extensions..js 
(module.js:663:10)
W20181002-15:38:55.742(5)? (STDERR)     at Module.load (module.js:565:32)
W20181002-15:38:55.743(5)? (STDERR)     at tryModuleLoad (module.js:505:12)
W20181002-15:38:55.743(5)? (STDERR)     at Function.Module._load 
(module.js:497:3)
W20181002-15:38:55.744(5)? (STDERR)     at Module.require (module.js:596:17)
W20181002-15:38:55.744(5)? (STDERR)     at require 
(internal/module.js:11:18)
W20181002-15:38:55.745(5)? (STDERR)     at Object.<anonymous> 
(D:\react_projects\backstage-check\node_modules\griddle- 
react\dist\module\index.js:31:19)
W20181002-15:38:55.746(5)? (STDERR)     at Module._compile 
(module.js:652:30)
W20181002-15:38:55.747(5)? (STDERR)     at Object.Module._extensions..js 
(module.js:663:10)
W20181002-15:38:55.748(5)? (STDERR)     at Module.load (module.js:565:32)
W20181002-15:38:55.748(5)? (STDERR)     at tryModuleLoad (module.js:505:12)
W20181002-15:38:55.749(5)? (STDERR)     at Function.Module._load 
(module.js:497:3)
1

There are 1 answers

0
Mohamed Allal On

Try to update to the latest version. I bet you installed with npm i --save react-griddle@beta (don't use beta). And use npm i --save react-griddle.

The reason is the propType, which was part of react core. And then in newer versions (which is pretty old now) it was moved to it's own package.

Here captures to illustrate that.

old: Screenshot from 2019-03-13 02-00-29

newer versions: Screenshot from 2019-03-13 02-00-13

The capture show the transpiled code.

Check the doc if it's not clear! https://reactjs.org/docs/typechecking-with-proptypes.html