@teknologist Genius! How did you arrive at the idea to do that?
@teknologist Seriously. Wow! I am back from the dead.
Maybe not a “temp fix” at all. That react
preset seems to be redundant, in my app anyway.
thx for fix, its working,
can you pls show my your package.json
@warehouseman Yep… I can’t see anything broken either here…
@achtan Sure, here it is (the public and interesting part):
{
"scripts": {
"test": "meteor test --driver-package practicalmeteor:mocha --port 5000",
"chimp-watch": "chimp --ddp=http://localhost:3000 --watch --mocha --path=tests",
"chimp-test": "chimp --ddp=http://localhost:3000 --mocha --path=tests",
"flow-typed": "mv .flow-typed flow-typed && flow-typed install && mv flow-typed .flow-typed"
},
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-plugin-react-require": "^3.0.0",
"babel-plugin-transform-class-properties": "^6.19.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-proto-to-assign": "^6.9.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-polyfill": "^6.20.0",
"babel-preset-latest": "^6.16.0",
"babel-preset-meteor": "^6.14.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-2": "^6.18.0",
"babel-root-slash-import": "^3.1.0",
"chimp": "^0.45.1",
"eslint": "^3.12.2",
"eslint-config-airbnb": "^13.0.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-meteor": "^4.0.1",
"eslint-plugin-react": "^6.8.0",
"flow-bin": "^0.37.0",
"phantomjs2": "^2.2.0",
"react-addons-test-utils": "^15.4.1"
},
"eslintConfig": {
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"meteor",
"react"
],
"extends": [
"airbnb/base",
"plugin:meteor/guide",
"plugin:react/recommended"
],
"globals": {
"server": false,
"browser": false,
"expect": false
},
"rules": {
"import/no-unresolved": 0,
"import/no-extraneous-dependencies": 0,
"import/extensions": 0,
"no-underscore-dangle": [
"error",
{
"allow": [
"_id",
"_ensureIndex",
"_verifyEmailToken",
"_resetPasswordToken",
"_name"
]
}
],
"class-methods-use-this": 0
}
},
"dependencies": {
"algoliasearch": "^3.20.1",
"babel-runtime": "^6.20.0",
"bcrypt": "^1.0.1",
"class-autobind": "^0.1.4",
"classnames": "^2.2.5",
"draft-js": "^0.9.1",
"draft-js-utils": "^0.1.7",
"ejson": "^2.1.2",
"faker": "^3.1.0",
"formsy-material-ui": "^0.5.3",
"formsy-react": "^0.19.0",
"i18n-react": "^0.3.0-ts1",
"lodash": "^4.17.2",
"material-ui": "^0.16.5",
"meteor-deque": "^2.1.0",
"meteor-node-stubs": "^0.2.4",
"mobile-detect": "^1.3.5",
"moment": "^2.17.1",
"react": "^15.4.1",
"react-addons-pure-render-mixin": "^15.4.1",
"react-addons-update": "^15.4.1",
"react-avatar-editor": "^6.1.0",
"react-bootstrap": "^0.30.7",
"react-dnd": "^2.1.4",
"react-dnd-html5-backend": "^2.1.2",
"react-dom": "^15.4.1",
"react-dropzone": "^3.7.3",
"react-fontawesome": "^1.5.0",
"react-komposer": "2.0.0",
"react-materialui-notifications": "^0.4.1",
"react-router": "^3.0.0",
"react-router-bootstrap": "^0.23.1",
"react-router-scroll": "^0.4.1",
"react-rte": "^0.11.0",
"react-spinner": "^0.2.6",
"react-tap-event-plugin": "^2.0.1",
"react-window-resize-listener": "^1.1.0",
"throttle-debounce": "^1.0.1",
"uuid": "^3.0.1"
}
}
NOTE: it still has unused presets… i’ll remove them eventually
I have literally spent the last 6 hours getting around this! First time in 3 years of meteor dev that I come across something that blocks me that much from working, seriously…
After a few hours reverting git commits, restoring time machine backups for node_modules etc…I was desperate.
Also because sometimes it worked, most of the time not…the app would start , than after code refresh…boom!
Than I cloned The meteor’s Chef Base (which I bootstrapped the project from a while ago, it has the same frameworks/setup, meteor ES6, React etc.) …And I didn’t see the error. Than I noticed it did not have a .babelrc (because it doesn’t use the transforms I do use)…
I came to the conclusion that it was directly related to my particular setup of babel transforms/presets…
Hope this helps…
I can easily believe 6 hours. It took me an hour just to convince myself that I was not to blame.
Do you use dave-dm.org badges?
I have been, but my version settings were far too loose, and this event today has scared me. I’m going to fix my versions to single specific releases, use his badges to warn me of upgrade availabilities and handle them manually, from now on.
It would not have helped in this case I don’t think, but doing that is a good defensive measure I think.
@warehouseman same same. I had 6.x.x versions I just switched them all to ^6.20.0 types…
I do not use the badges (the project is private and not published) but I use https://www.npmjs.com/package/npm-check-updates and do my checks manually (very nice).
Good to know. I was not aware of that tool.
@warehouseman This one https://www.npmjs.com/package/npm-check even checks you es6 imports for missing deps and unsued packages! … I will have a look…
UPDATE: does not seem to play nice with meteor as it does not understand all the 'implied ’ modules from meteor… https://www.npmjs.com/package/npm-check-updates aka ncu works flawless for me…
then there are the Meteor package versions to worry about…
@warehouseman to be honest I rely more and more on npm. And the meteor packages are very stale… plus I do the meteor update from time to time…painless…
In fact, Meteor still has not failed you, has it?! It was something external, right?
Ultimately – Yes, we have to open ourselves up to the ‘npm’ maelstrom, but it sure was nice to be able to trust Meteor update
.
Ok I found the exact babel plugin breaking everything:
babel-plugin-transform-react-jsx
I thought I’d go through all the plugins from the react preset one by one and see which one triggers the error… That is the one!
And there you go!
Armageddon Commit: https://github.com/babel/babel/commit/2bbc36d25e8b9bd0241896d74813bad448064c8b
Link to my comment on the repo:
So, I’ve discovered why I need the “react” preset – my mocha tests crash without it.
Currently, I depend more on Chimp Cucumber, so I don’t care all that much, for now.
Any idea of an alternative to --compilers js:babel-core/register
?
{
"name": "meteor-mantra-kickstarter",
"version": "0.2.1",
"scripts": {
"testonly": "mocha .scripts/mocha_boot.js client/**/tests/**/*.js --compilers js:babel-core/register",
@warehouseman good catch. I knew I needed the preset for something…Was so eager to get the app running that I didn’t care to run a batch of tests…Just tested meteor run/build
Just be patient. Have a look at the GitHub pull comments.
Maintainer is aware, we’ll probably get a fix very soon.
Seems a lot of people are impacted.
Just do like me , take the weekend off …
I have a thoroughly dopey workaround for keeping my CI green :
(don’t laugh)
Everyone,
The problem is solved. Just uninstall babel-preset-react and reinstall it!
You should have its babel-helper-builder-react-jsx dependency @6.21.1 now.
That fixed the error on my side.
More infos in the github pull request comments (link posted earlier here)
Have a nice end of weekend everyone!
Cheers!
├─┬ babel-preset-react@6.16.0
│ ├─┬ babel-plugin-transform-react-jsx@6.8.0
│ │ └── babel-helper-builder-react-jsx@6.21.1
│ ├── babel-plugin-transform-react-jsx-self@6.11.0
│ └── babel-plugin-transform-react-jsx-source@6.9.0
Well done @teknologist ! Thank you for your in investigation.
It’s OK for me about this issue.
I just have another issue to fix…
This also solved my problem. Thank you!