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

CoreJS build fails during deploy #72

Closed
jthomaschewski opened this issue Oct 5, 2015 · 11 comments · Fixed by #82
Closed

CoreJS build fails during deploy #72

jthomaschewski opened this issue Oct 5, 2015 · 11 comments · Fixed by #82

Comments

@jthomaschewski
Copy link
Contributor

I've found a strange bug when using the deploy script with CI:

  1. Start with clean repository (corejs not build ...)
  2. Run npm install and node deploy.js meteor.com
  3. CoreJS build fails:
Building core-js@1.2.1 without ES6 number constructor...

> meteor-webpack-react@0.0.1 build-core-js /home/janek/tmp/meteor-webpack-react-jbbr
> grunt --gruntfile node_modules/core-js/Gruntfile.js build:es5,es6,es7,js,web --blacklist=es6.number.constructor --path=core-js-no-number

Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'LiveScript'
Warning: Task "build:es5,es6,es7,js,web" not found. Use --force to continue.

Aborted due to warnings.

npm ERR! Linux 4.2.2-1-ARCH
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "build-core-js"
npm ERR! node v4.1.1
npm ERR! npm  v3.3.5
npm ERR! code ELIFECYCLE
npm ERR! meteor-webpack-react@0.0.1 build-core-js: `grunt --gruntfile node_modules/core-js/Gruntfile.js build:es5,es6,es7,js,web --blacklist=es6.number.constructor --path=core-js-no-number`
npm ERR! Exit status 3
npm ERR! 
npm ERR! Failed at the meteor-webpack-react@0.0.1 build-core-js script 'grunt --gruntfile node_modules/core-js/Gruntfile.js build:es5,es6,es7,js,web --blacklist=es6.number.constructor --path=core-js-no-number'.
npm ERR! This is most likely a problem with the meteor-webpack-react package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     grunt --gruntfile node_modules/core-js/Gruntfile.js build:es5,es6,es7,js,web --blacklist=es6.number.constructor --path=core-js-no-number
npm ERR! You can get their info via:
npm ERR!     npm owner ls meteor-webpack-react
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/janek/tmp/meteor-webpack-react-jbbr/npm-debug.log
mv: no such file or directory: core-js-no-number.js

ln: Source file does not exist

Hash: a941a9b3171a0f8f2a31  
Version: webpack 1.12.2
Time: 733ms

After using the dev.js script at least one time deploy.js runs fine.

I don't know why this happens as core-js build script is required the same way. Maybe it's due to different environment variables?

@jedwards1211
Copy link
Owner

Huh, I don't think it's environment variables, maybe it failed to npm install within the core-js folder. In any case I need to investigate if the core-js custom build is even necessary anymore, since Meteor now has some builtin ES2015 support they may have fixed the Number constructor issue.

@jthomaschewski
Copy link
Contributor Author

By looking at the error message I would think the same. But When running npm install and then node dev.js the corejs build runs fine.
So this happens only when using deploy.js instead of dev.js - on the same environment with the git repository cleaned before running the script.

@jedwards1211
Copy link
Owner

I'm still getting the match errors when doing something like collection.find({}, {limit: 3}) due to the Number constructor polyfill with the latest version of Meteor...which would mean they're doing something weird to support it with their ES2015 plugin that doesn't also apply to externally transpiled code.
I should log an issue in their tracker about this...

@jedwards1211
Copy link
Owner

Have you tried this on clean install? This would certainly indicate that the npm install call from core-js-custom-build.js isn't working on your CI server

> npm install
> cd node_modules/core-js
> npm install
> cd ../..
> node deploy.js meteor.com

@jthomaschewski
Copy link
Contributor Author

Yes, this happens on a clean install of the current master of this skeleton.
And not only on my CI server (Debian) but also on my local machine (Arch Linux) - both node 4.1 and npm 3.
Running npm install manually on the core-js folder as you suggested helped. So there seems to be a problem with the "core-js-custom-build.js" call - but only in deploy.js. As it's called the same way there must be some difference somewhere else...

@jedwards1211
Copy link
Owner

Weird. I do need to start using the latest versions of Node. I wonder if shelljs can cause any problems...I've noticed that exec calls swallow dynamic things printed to the terminal, like download progress meters that would show when running the core-js custom build via bash script.
I may not have much more time leftover to work on this project this week...but feel free to make a PR if you figure out what's wrong

@tomitrescak
Copy link

Pardon my off topic. But which version of node is recommended? I am using 0.10.40 for compatibility issues with Meteor.

@jthomaschewski
Copy link
Contributor Author

I'm using latest node 4.1.2 and npm 3.3.5 and don't have any issues.

jedwards1211 wrote:

Weird. I do need to start using the latest versions of Node

I assume this skeleton is tested with older versions of node

@tomitrescak what kind of compatibility issues do you have with meteor? I thought the meteor install includes node and is in independed from the system wide installed version.

@tomitrescak
Copy link

@JBBr Not even Node 0.12.x was recommended for meteor. If you use MUP or some other deploy tools, the 0.10.40 is the latest they install. I did not try to discover why is that, just accepted it as a fact.

@jthomaschewski
Copy link
Contributor Author

@tomitrescak Yes that's true for running meteor bundles directly with node (e.g. using meteor bundle or demeteorizer).
But in the skeleton the meteor command is executed in the background. Node is only used to run some scripts and webpack/webpack-dev-server.

The meteor server is still using the included node version (maybe still 0.10.x, maybe updated in Meteor 1.2)

@jthomaschewski
Copy link
Contributor Author

Back to topic @jedwards1211:

I've found a way to fix the problem. It does only occur if core-js-custom-build is required inside a exported function (module.exports).
If it's required before module.exports build runs fine.

I'll do a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants