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

Npm.require() is broken #3505

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

Npm.require() is broken #3505

hipertracker opened this issue Jan 20, 2015 · 5 comments

Comments

@hipertracker
Copy link

@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
Copy link
Member

@glasser 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
Copy link
Author

@hipertracker 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
Copy link
Member

@glasser glasser commented Jan 21, 2015

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

@avital avital reopened this Jan 23, 2015
@avital
Copy link
Contributor

@avital 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants