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

Cannot find module 'numbro' #3627

Closed
mscreenie opened this issue Jul 2, 2016 · 11 comments
Closed

Cannot find module 'numbro' #3627

mscreenie opened this issue Jul 2, 2016 · 11 comments

Comments

@mscreenie
Copy link

When trying to use a Bare distribution there the error "Cannot find module 'numbro'".

Tried including numbro. Doesn't work.

@AMBudnik
Copy link
Contributor

AMBudnik commented Jul 4, 2016

Can you create a demo when we can replicate the issue @mscreenie ?

@alex-erygin
Copy link

alex-erygin commented Jul 7, 2016

I have the same issue

@budnix
Copy link
Member

budnix commented Jul 7, 2016

@mscreenie, @alex-erygin Did you tried include numbroJS (and rest required modules) before handsontable script? I've created working demo at http://jsfiddle.net/uojf62ja/2/.

@alex-erygin
Copy link

alex-erygin commented Jul 7, 2016

@budnix , thank you. This solution works:

    <script src="http://docs.handsontable.com/pro/1.5.0/bower_components/numbro/dist/numbro.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pikaday/1.4.0/pikaday.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/zeroclipboard/2.2.0/ZeroClipboard.min.js"></script>

But how can I make it work in a react js component?

@budnix
Copy link
Member

budnix commented Jul 8, 2016

In react js you should import Handsontable with all required modules via import. It should work as described here #3407 (related issue).

@mscreenie
Copy link
Author

mscreenie commented Aug 24, 2016

This is still an issue and I did not close, just include barebones JS in the order of readme to reproduce.

In my test case I am not using React, Boilerplate etc. Just Vanilla JS. Someone suggested Handsontable needs the modules to be defined as global which I'm not too sure is the problem. @AMBudnik

@mscreenie
Copy link
Author

I'll demo the issue thanks.

@budnix budnix self-assigned this Oct 13, 2016
@budnix
Copy link
Member

budnix commented Oct 14, 2016

Hi @mscreenie, Does this issue with loading Handsontable dependencies still occur? If you use Vanilla JS without any build tool this simple solution should work:

<script src="https://cdnjs.cloudflare.com/ajax/libs/numbro/1.9.3/numbro.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pikaday/1.4.0/pikaday.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zeroclipboard/2.2.0/ZeroClipboard.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.28.4/handsontable.min.js"></script>

or as a single bundle

<script src="https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.28.4/handsontable.full.min.js"></script>

@mscreenie
Copy link
Author

mscreenie commented Oct 14, 2016

@budnix Thanks for your excellent support.

I think I've solved this. The problem was not handsontable. I was loading handsontable inside a desktop chrome shell based on Chromium 41 - nwjs 12.3. Upon testing in latest Chrome I did not encounter any issues but when I tested in v.41. I encountered the numbro error. It's not necessarily a handsontable error - I don't expect handsontable to be tested against Chromium versions that old, nor did I expect this error because 41 has good ECMA support.

edit: I don't know if its already done or todo but having dependencies available globally inside .full would be cool, such as pikaday etc.

Again thanks for your continued support.

@jonnyscholes
Copy link

I also had this issue. I resolved it by doing this (using babel + browserify):

import Handsontable from 'handsontable/dist/handsontable.full';

@DevShirish
Copy link

Hi i am facing same issue and,here is link for description http://stackoverflow.com/questions/41638471/how-to-use-handsontable-library-in-angular-2
Can anybody provide the solution

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

No branches or pull requests

6 participants