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

Uncaught TypeError: Cannot read property 'register' of undefined #10

Closed
yulolimum opened this issue Aug 2, 2016 · 6 comments
Closed
Labels
Milestone

Comments

@yulolimum
Copy link
Contributor

I added torch to package.json and installed. It's loading the torch.js but erring on the pickaday import:

Using webpack.

It may be due to the fact that moment is an "optionalDependency".

@darinwilson
Copy link
Contributor

This appears to be an issue with webpack configuration, as it doesn't happen with brunch. I'm putting this on hold for now, but will look into later as we'll be using torch on a webpack project, and I may learn more about this issue then.

@darinwilson
Copy link
Contributor

After further research, it appears that brunch is ill-suited to create NPM packages:

brunch/brunch#713

Brunch has historically been meant for building web apps, not libs, so this hasn't been that important for the type of use-cases Brunch typically targets.

I think this explains why the package works fine in a brunch-managed project, but not a webpack-managed project.

If I'm reading the issue correctly, we'll need a different build process to create a fully NPM-compatible package for torch.

@danielberkompas
Copy link
Contributor

@darinwilson Now that we have integrated Torch with CrossConnect, which uses webpack, did this actually end up being a problem?

@darinwilson
Copy link
Contributor

@danielberkompas Sorry I didn't respond to this sooner. Yes, it's still a problem. I had to do some hacking to get it to work with CC. See the PR for torch integration

From what I could tell, it seems that creating an NPM package with brunch makes it incompatible with webpack. I'm not 100% sure about that, but other folks reported similar problems. At that point, it became to keep of a rabbit hole to pursue, so I just put some duct tape on the CC JS setup and moved on.

@zberkom
Copy link
Contributor

zberkom commented Apr 21, 2017

@danielberkompas I think this may have been fixed by removing the umbrella application. Is that correct?

@darinwilson darinwilson added this to the v1.0 milestone May 2, 2017
@zberkom
Copy link
Contributor

zberkom commented May 30, 2017

I just tested this with the latest version of webpack and had no issues. I'm closing this issue for now & reopening an .npmignore issue, since the package in node_modules is currently including the entire git repo.

image

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

No branches or pull requests

4 participants