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

Npm.require() is broken #3505

Closed
hipertracker opened this Issue Jan 20, 2015 · 5 comments

Comments

Projects
None yet
3 participants
@hipertracker

hipertracker commented Jan 20, 2015

It looks like Npm.require() has a serious bug. I need to download ReactJS with addons. In CommonJS it is as simple as require('react/addons'). Unfortunately, this type of syntax does not work in Meteor. Using Npm.require('react/addons') is complaining about missing dependencies. But there is no any dependency needed here. There is no NPM package called 'react/addons'.

@glasser

This comment has been minimized.

Member

glasser commented Jan 21, 2015

I'm a little surprised by this. Can you show a reproduction? See https://github.com/meteor/meteor/wiki/Contributing-to-Meteor#reporting-a-bug-in-meteor

@glasser glasser closed this Jan 21, 2015

@hipertracker

This comment has been minimized.

hipertracker commented Jan 21, 2015

Npm.require('react') works as expected. But try to use Npm.require('react/addons'). Meteor cannot resolve such package name.

W20150121-08:35:14.054(0)? (STDERR) /Users/hipertracker/.meteor/packages/meteor-tool/.1.0.38.z83ibe++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:173
W20150121-08:35:14.054(0)? (STDERR)             throw(ex);
W20150121-08:35:14.054(0)? (STDERR)                   ^
W20150121-08:35:14.055(0)? (STDERR) Error: Can't find npm module 'react/addons'. Did you forget to call 'Npm.depends' in package.js within the 'hipertracker_reactjs' package?
W20150121-08:35:14.055(0)? (STDERR)     at Object.Npm.require (/Users/hipertracker/Documents/MOJE/projekty/EXPERIMENT/meteor-package-example/.meteor/local/build/programs/server/boot.js:117:17)
W20150121-08:35:14.055(0)? (STDERR)     at ReactMeteorMixin._handleMeteorChange (packages/hipertracker:reactjs/src/require-react.js:1:1)
W20150121-08:35:14.055(0)? (STDERR)     at /Users/hipertracker/Documents/MOJE/projekty/EXPERIMENT/meteor-package-example/.meteor/local/build/programs/server/packages/hipertracker_reactjs.js:22:4
W20150121-08:35:14.055(0)? (STDERR)     at /Users/hipertracker/Documents/MOJE/projekty/EXPERIMENT/meteor-package-example/.meteor/local/build/programs/server/packages/hipertracker_reactjs.js:93:3
W20150121-08:35:14.055(0)? (STDERR)     at /Users/hipertracker/Documents/MOJE/projekty/EXPERIMENT/meteor-package-example/.meteor/local/build/programs/server/boot.js:175:10
W20150121-08:35:14.055(0)? (STDERR)     at Array.forEach (native)
W20150121-08:35:14.056(0)? (STDERR)     at Function._.each._.forEach (/Users/hipertracker/.meteor/packages/meteor-tool/.1.0.38.z83ibe++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150121-08:35:14.056(0)? (STDERR)     at /Users/hipertracker/Documents/MOJE/projekty/EXPERIMENT/meteor-package-example/.meteor/local/build/programs/server/boot.js:86:5
@glasser

This comment has been minimized.

Member

glasser commented Jan 21, 2015

You did not follow the directions at the link I gave you.

@hipertracker

This comment has been minimized.

hipertracker commented Jan 21, 2015

@avital avital reopened this Jan 23, 2015

@avital

This comment has been minimized.

Contributor

avital commented Jan 23, 2015

Looks like there's a pull request for this issue at #3526?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment