Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.12.4 doesn't work in strict mode #1918

Closed
Nic128 opened this issue Oct 19, 2015 · 28 comments · Fixed by #1922
Closed

0.12.4 doesn't work in strict mode #1918

Nic128 opened this issue Oct 19, 2015 · 28 comments · Fixed by #1922
Labels
docs Improvements or additions to the documentation

Comments

@Nic128
Copy link

Nic128 commented Oct 19, 2015

material-ui/lib/table/table-body.js:42
propTypes: {
^^^^^^^^^
SyntaxError: Duplicate data property in object literal not allowed in strict mode
#1917 this merge request was merged right after 0.12.4 was released. Can we get a 0.12.5? Otherwise can't use 0.12.4.

@oliviertassinari
Copy link
Member

This was fixed by #1917.
@shaurya947 Should we do a hot-fix release?

@bdefore
Copy link

bdefore commented Oct 19, 2015

Also having this issue. 0.12.4 isn't usable for me.

@shaurya947
Copy link
Contributor

agreed. On it

@soda29
Copy link

soda29 commented Oct 19, 2015

Same at

/var/development/granliga/redux-gl/node_modules/material-ui/lib/time-picker/clock-hours.js:64
[1] propTypes: {
[1]
[1]
[1] ^

@shaurya947
Copy link
Contributor

@oliviertassinari can you take a look at everything else to make sure that it works in strict mode? I'm finding ways to do the same.

Also, timepicker seems broken on the docs site. Something with the isRtl stuff @louy

@louy
Copy link
Contributor

louy commented Oct 19, 2015

The issue was that I added "position" instead of "muiTheme" to propTypes by mistake.
Please close #1921 and update #1920 to reflect this. Sorry about that.
Still checking the broken TimePicker.

@oliviertassinari
Copy link
Member

@louy #1921 Should be fixing the TimePicker.

@shaurya947
Copy link
Contributor

The issue was that I added "position" instead of "muiTheme" to propTypes by mistake.

@louy not sure what you mean. You wanted to add muiTheme to propTypes?

@louy
Copy link
Contributor

louy commented Oct 19, 2015

The issue is that "muiTheme" isn't define. #1921 breaks RTL.
I think the lack of "contextTypes" is causing it.

@shaurya947 nope sorry. Got confused a bit. I was supposed to copy contextTypes instead of propTypes.

@louy
Copy link
Contributor

louy commented Oct 19, 2015

I'll send a PR.

@oliviertassinari
Copy link
Member

@louy Ok thanks, I have removed prepareStyles because we don't use RTL behaviour on those two styles.

louy added a commit to louy/material-ui that referenced this issue Oct 19, 2015
@louy
Copy link
Contributor

louy commented Oct 19, 2015

Ok guys I have no idea how this bug works but I have been able to solve it somehow. I think it's related to <Dialog> or something.

The issue is that context.muiTheme wasn't passed from <Clock> (which is inside a <Dialog>) to <ClockHour>. I solved it somehow by adding contextTypes.muiTheme to <Clock>.

@shaurya947
Copy link
Contributor

@Nic128 @soda29 can you tell me a little about how you were using the components? I'm trying to find a way to parse all source files to make sure that fix this issue once and for all..

@louy
Copy link
Contributor

louy commented Oct 20, 2015

I think they were trying to pack it with something else and add 'use strict' to the whole file. Browserify w/ Grunt/Gulp maybe?

@oliviertassinari
Copy link
Member

@shaurya947 #1933 We should be ok with this PR regarding strict mode. Well at least, duplicated properties.

@Nic128
Copy link
Author

Nic128 commented Oct 20, 2015

@shaurya947 I was using server side rendering with react-router.

Edit: Also using babel with stage 0.

@bdefore
Copy link

bdefore commented Oct 20, 2015

@shaurya947 i was using webpack with stage 0 babel

tyfoo pushed a commit to tyfoo/material-ui that referenced this issue Oct 21, 2015
tyfoo pushed a commit to tyfoo/material-ui that referenced this issue Oct 21, 2015
@rkstar
Copy link

rkstar commented Oct 21, 2015

still having this problem in meteor as well.
please update npm repo with the fix

@oliviertassinari
Copy link
Member

please update npm repo with the fix

@shaurya947 Is working on it.

@oliviertassinari
Copy link
Member

New versions were released to adresse this issue.

@rkstar
Copy link

rkstar commented Oct 21, 2015

i updated to 0.13.0 but it is still throwing the same errors in meteor:

W20151021-19:39:25.590(-4)? (STDERR) /Users/rkstar/dev/projects/spotify/.meteor/local/build/programs/server/app/lib/config/app.browserify.js:13951
W20151021-19:39:25.590(-4)? (STDERR)   propTypes: {                                                         // 42
W20151021-19:39:25.590(-4)? (STDERR)   ^^^^^^^^^
W20151021-19:39:25.590(-4)? (STDERR) SyntaxError: Duplicate data property in object literal not allowed in strict mode
W20151021-19:39:25.590(-4)? (STDERR)     at /Users/rkstar/dev/projects/spotify/.meteor/local/build/programs/server/boot.js:241:30
W20151021-19:39:25.590(-4)? (STDERR)     at Array.forEach (native)
W20151021-19:39:25.590(-4)? (STDERR)     at Function._.each._.forEach (/Users/rkstar/.meteor/packages/meteor-tool/.1.1.9.4tzxrv++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20151021-19:39:25.590(-4)? (STDERR)     at /Users/rkstar/dev/projects/spotify/.meteor/local/build/programs/server/boot.js:137:5
=> Exited with code: 8

just to confirm, i cat'd the package.json file that was imported into my project:

{
  "name": "material-ui",
  "author": {
    "name": "Call-em-all Engineering Team"
  },
  "version": "0.13.0",
  "description": "Material Design UI components built with React",
  "main": "./lib",
  "scripts": {
    "test": "npm run test-base -- --single-run",
    "test-watch": "npm run test-base -- --auto-watch",
    "test-base": "karma start",
    "prebuild": "rimraf lib",
    "eslint": "gulp eslint",
    "build": "npm run eslint && babel --stage 1 ./src --out-dir ./lib",
    "prepublish": "npm run build"
  },
  "keywords": [
    "react",
    "react-component",
    "material design",
    "material-ui",
    "material ui"
  ],
  "repository": {
    "type": "git",
    "url": "git+https://github.com/callemall/material-ui.git"
  },
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/callemall/material-ui/issues"
  },
  "homepage": "http://material-ui.com/",
  "peerDependencies": {
    "react": "^0.14.0",
    "react-dom": "^0.14.0",
    "react-tap-event-plugin": "^0.2.0",
    "react-addons-transition-group": "^0.14.0",
    "react-addons-update": "^0.14.0",
    "react-addons-create-fragment": "^0.14.0",
    "react-addons-pure-render-mixin": "^0.14.0"
  },
  "devDependencies": {
    "babel": "^5.4.3",
    "babel-core": "^5.8.21",
    "babel-eslint": "^4.1.3",
    "babel-loader": "^5.3.2",
    "babel-runtime": "^5.8.25",
    "babelify": "^6.1.3",
    "browserify-istanbul": "^0.2.1",
    "chai": "^3.2.0",
    "eslint": "^1.1.0",
    "eslint-loader": "^1.0.0",
    "eslint-plugin-react": "^3.2.2",
    "fbjs": "^0.2.1",
    "gulp": "^3.9.0",
    "gulp-eslint": "^1.0.0",
    "html-webpack-plugin": "^1.6.1",
    "karma": "^0.13.3",
    "karma-browserify": "^4.2.1",
    "karma-chai-sinon": "^0.1.5",
    "karma-coverage": "^0.4.2",
    "karma-mocha": "^0.2.0",
    "karma-mocha-reporter": "^1.0.4",
    "karma-phantomjs-launcher": "^0.2.0",
    "karma-webpack": "^1.7.0",
    "mocha": "^2.2.5",
    "phantomjs": "^1.9.17",
    "react": "^0.14.0",
    "react-addons-create-fragment": "^0.14.0",
    "react-addons-pure-render-mixin": "^0.14.0",
    "react-addons-transition-group": "^0.14.0",
    "react-addons-update": "^0.14.0",
    "react-dom": "^0.14.0",
    "react-hot-loader": "^1.2.8",
    "react-router": "^1.0.0-rc1",
    "react-tap-event-plugin": "^0.2.0",
    "rimraf": "^2.4.3",
    "sinon": "^1.15.4",
    "sinon-chai": "^2.8.0",
    "transfer-webpack-plugin": "^0.1.4",
    "webpack": "^1.11.0"
  },
  "gitHead": "7980cd589e9dc9e055e1b789bf2f80e7f2ef0f5d",
  "_id": "[email protected]",
  "_shasum": "ccd5e5aa9d3db4027374b5b6d065f1e9a64b8c1e",
  "_from": "[email protected]",
  "_npmVersion": "2.14.6",
  "_nodeVersion": "0.12.7",
  "_npmUser": {
    "name": "shaurya947",
    "email": "[email protected]"
  },
  "dist": {
    "shasum": "ccd5e5aa9d3db4027374b5b6d065f1e9a64b8c1e",
    "tarball": "http://registry.npmjs.org/material-ui/-/material-ui-0.13.0.tgz"
  },
  "maintainers": [
    {
      "name": "callemall",
      "email": "[email protected]"
    },
    {
      "name": "hai-cea",
      "email": "[email protected]"
    },
    {
      "name": "jtollerene",
      "email": "[email protected]"
    },
    {
      "name": "mmrtnz",
      "email": "[email protected]"
    },
    {
      "name": "shaurya947",
      "email": "[email protected]"
    }
  ],
  "directories": {},
  "_resolved": "https://registry.npmjs.org/material-ui/-/material-ui-0.13.0.tgz",
  "readme": "ERROR: No README data found!"
}

thoughts?

@bdefore
Copy link

bdefore commented Oct 22, 2015

the 0.13.0 release is working for me without build problems

@TimothyKrell
Copy link

0.13.0 fixed the build errors in webpack for me as well.

@shaurya947
Copy link
Contributor

@rkstar can you try to identify which particular source file / module (if any) is the culprit?

@oliviertassinari
Copy link
Member

Should we reopen this issue?

@shaurya947 shaurya947 reopened this Oct 22, 2015
@rkstar
Copy link

rkstar commented Oct 22, 2015

i'm using it with meteor react packages following this process for adding npm packages

meteor is using react 0.13.3 and i noticed react@^0.14.0 in the package.json for the 0.13.0 material-ui release. could this be the problem?

material-ui 0.12.3 works fine w/my app, but 0.12.4 throws the propTypes error above (as does 0.13.0).

@oliviertassinari
Copy link
Member

@rkstar Can you try 0.12.5?

@rkstar
Copy link

rkstar commented Oct 23, 2015

i started a clean project and attempted 0.13.0 again and this time there were no errors. my react version is still using meteor's 0.13.3 react, but material-ui did not throw the propTypes error that it had been previously.

it seems this may have been a case of the way the meterohacks:npm and npm-container packages upgraded material-ui when i changed the packages.json file from 0.12.3 to 0.13.0

thanks for your attention to this @oliviertassinari and @shaurya947

alitaheri pushed a commit to alitaheri/material-ui that referenced this issue Oct 27, 2015
mnajdova pushed a commit to mnajdova/material-ui that referenced this issue Nov 10, 2020
Bumps [@types/prismjs](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prismjs) from 1.16.0 to 1.16.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/prismjs)

Signed-off-by: dependabot-preview[bot] <[email protected]>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
@zannager zannager added the docs Improvements or additions to the documentation label Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants