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 ReferenceError: merge is not defined #2

Closed
antonagestam opened this issue Feb 25, 2015 · 23 comments · Fixed by #3 or #5
Closed

Uncaught ReferenceError: merge is not defined #2

antonagestam opened this issue Feb 25, 2015 · 23 comments · Fixed by #3 or #5
Labels

Comments

@antonagestam
Copy link

Using the standalone version i get "Uncaught ReferenceError: merge is not defined" when running the script. It looks like it's the code from he.js that hasn't been properly included.

On this line merge is called in the standalone file, but it's not defined anywhere inside that file:
https://github.com/IonicaBizau/medium-editor-markdown/blob/master/dist/me-markdown.standalone.js#L7

Here merge is defined in he.js:
https://github.com/mathiasbynens/he/blob/master/src/he.js#L89

@IonicaBizau
Copy link
Owner

Good point!

However, I cannot reproduce it in the demo, using the standalone version too: http://ionicabizau.github.io/medium-editor-markdown/

What do you do just before of error throwing?

@antonagestam
Copy link
Author

@IonicaBizau The error throws on page load as far as I can tell. That is very strange, could it be because I am using "use strict"; and you're not?

@IonicaBizau
Copy link
Owner

I cannot reproduce it even using "use strict";, but definitely the merge function should be added.

@antonagestam
Copy link
Author

@IonicaBizau Cool, just to be clear, my "use strict"; statement is in the script that calls new MeMarkdown();, don't know if that makes any difference. :)

@fer-ri
Copy link

fer-ri commented Mar 22, 2015

This is the line which produce error

image

This is from my console

image

And this is my code

image

Thanks

@IonicaBizau IonicaBizau self-assigned this Mar 22, 2015
@IonicaBizau
Copy link
Owner

I'm on it! Will make the changes in another branch.

@fer-ri
Copy link

fer-ri commented Mar 22, 2015

Wow .. very fast response ...

Thanks 👍

@IonicaBizau
Copy link
Owner

Yep! Shouldn't be complicated I guess. 😄

BTW, are there anything special steps to make this error appear? Also, what browser/OS are you using?

@fer-ri
Copy link

fer-ri commented Mar 22, 2015

I use latest chrome + win 7 ..

I think its because options that being passed to MediumEditor when initialized like this

contentEditor   = new MediumEditor('.content-editable', {
            buttons: ['bold', 'anchor', 'header2', 'pre'],
            buttonLabels: 'fontawesome',
});

💃

IonicaBizau added a commit that referenced this issue Mar 22, 2015
 - merge() /cc Fixes #2.
 - codePointToSymbol()
 - parseError()
@antonagestam
Copy link
Author

I used stable Chrome on OSX Yosemite if that helps.

@IonicaBizau
Copy link
Owner

See #3 for the rebuilt scripts. You can get the standalone version using:

$ wget https://raw.githubusercontent.com/IonicaBizau/medium-editor-markdown/8d41c8fb4e04f94e15a65dfd11ab827fc5a1c0fe/dist/me-markdown.standalone.min.js

(or clicking here)

@fer-ri
Copy link

fer-ri commented Mar 22, 2015

Got error using minified script above ..

image

@IonicaBizau
Copy link
Owner

@ghprod Can you please switch on the non-minified version and send me the line number where the error appears?

decode is not supposed to be called. Instead, it should be he.decode.

@fer-ri
Copy link

fer-ri commented Mar 22, 2015

here they are

image

@IonicaBizau
Copy link
Owner

@ghprod Good point! Check now.

@fer-ri
Copy link

fer-ri commented Mar 23, 2015

I'm sorry Ionica .. still error

image

image

@IonicaBizau
Copy link
Owner

Since I can't reproduce this error, it's a little bit difficult to commit these changes. Could you provide a JSFiddle reproducing the error?

Thanks!

@IonicaBizau
Copy link
Owner

/cc @ghprod @antonagestam

@antonagestam
Copy link
Author

@IonicaBizau I'm sorry, but I've moved away from using markdown in my project.

@fer-ri
Copy link

fer-ri commented Mar 27, 2015

@IonicaBizau I'm really sorry too, finally i must use codemirror + marked js ..

cheers for you 🍺

@IonicaBizau
Copy link
Owner

No problem for me. Getting this issue fixed is weird since I don't have any reproduction page.

However, using the *.no-deps.* version should be fine:

<script src="he.js"></script>
<script src="to-markdown.js"></script>
<script src="medium-editor.js"></script>
<script src="me-markdown.no-deps.js"></script>

@fer-ri
Copy link

fer-ri commented Mar 27, 2015

Yes,

thats what i did when last time i try to make it works 👍

using no-deps should fine for now ..

Thanks

@IonicaBizau IonicaBizau removed their assignment Apr 22, 2015
@IonicaBizau
Copy link
Owner

Could anyone create an online demo to reproduce the error?
I know these functions are not defined, but I don't know if the problem is fixed or not if a demo is missing.

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