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

require.js Error: Mismatched anonymous define() module #1218

Closed
lierisme opened this Issue Apr 30, 2017 · 7 comments

Comments

Projects
3 participants
@lierisme

lierisme commented Apr 30, 2017

use MkDocs

mydocs.yml:

site_name: My Docs

extra_javascript:
- https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.7/raphael.min.js
- https://cdnjs.cloudflare.com/ajax/libs/flowchart/1.6.5/flowchart.min.js
markdown_extensions:
- pymdownx.superfences

test.md

```flow
st=>start: Start:>http://www.google.com[blank]
e=>end:>http://www.google.com
op1=>operation: My Operation
sub1=>subroutine: My Subroutine
cond=>condition: Yes
or No?:>http://www.google.com
io=>inputoutput: catch something...

st->op1->cond
cond(yes)->io->e
cond(no)->sub1(right)->op1
```

run: mkdocs serve

http://127.0.0.1:8000

result:

Uncaught Error: Mismatched anonymous define() module: function () ......

why???
help!
thanks!

@facelessuser

This comment has been minimized.

Contributor

facelessuser commented Apr 30, 2017

This is better suited for the repo containing SuperFences. https://github.com/facelessuser/pymdown-extensions

@waylan

This comment has been minimized.

Member

waylan commented Apr 30, 2017

This is better suited for the repo containing SuperFences.

I agree. Please follow up there.

@waylan waylan closed this Apr 30, 2017

@lierisme

This comment has been minimized.

lierisme commented May 2, 2017

Thank you for your.

@facelessuser

This comment has been minimized.

Contributor

facelessuser commented May 2, 2017

@waylan I do think this might need some kind of fix in the default mkdocs theme. It appears some scripts don't play nice with being loaded after require.js and the mkdocs theme loads all extra scripts after require.js. I'm not sure if and how you'd guys would approach this, but the current setup limits what can be loaded in extra javascript. So feel free to reopen this if needed, but this seems to be an issue that can only be worked around by overriding the mkdocs theme base.html. See comment facelessuser/pymdown-extensions#67 (comment).

@facelessuser

This comment has been minimized.

Contributor

facelessuser commented May 2, 2017

Official statement from require.js on this error: http://requirejs.org/docs/errors.html#mismatch.

@waylan waylan reopened this May 2, 2017

@waylan waylan added the Bug label May 2, 2017

@waylan

This comment has been minimized.

Member

waylan commented May 2, 2017

IIRC, we only use require.js for search, which is getting a refactor. I had every intention of trying to remove the dependency on require.js in the refactor. This is another reason to add to the list. See Search Refactor for more info.

@waylan waylan added this to To Do in Refactor search. May 2, 2017

@waylan waylan changed the title from use 'pymdownx.superfences':Mismatched anonymous define() module to require.js Error: Mismatched anonymous define() module May 2, 2017

@facelessuser

This comment has been minimized.

Contributor

facelessuser commented May 2, 2017

Removing require.js is exactly what I would suggest. Seems like it would just be a pain to expect everyone to work around it. Sounds like a great module if you plan to build everything around it, but not so much for a generalized template where you don't know what the user is going to try to pair with it.

Thanks!

@waylan waylan added the Plugin label Nov 1, 2017

@waylan waylan moved this from To Do to Completed in new-search branch in Refactor search. Jan 31, 2018

waylan added a commit to waylan/mkdocs that referenced this issue Jan 31, 2018

@waylan waylan added this to the 1.0.0 milestone Feb 6, 2018

waylan added a commit to waylan/mkdocs that referenced this issue Feb 27, 2018

Implement fallback for no worker support
Fixes #1218, fixes #1127, and partially addresses #859.

@waylan waylan closed this in #1418 Mar 6, 2018

Refactor search. automation moved this from In Progress to Done Mar 6, 2018

waylan added a commit that referenced this issue Mar 6, 2018

Refactor search plugin (#1418)
* Use a web worker in the browser with a fallback (fixes #859 & closes #1396).
* Optionally pre-build search index (fixes #859 & closes #1061).
* Upgrade to lunr.js 2.x (fixes #1319).
* Support search in languages other than English (fixes #826).
* Allow the user to define the word separators (fixes #867).
* Only run searches for queries of length > 2 (fixes #1127).
* Remove dependency on require.js, mustache, etc. (fixes #1218).
* Compress the search index (fixes #1128).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment