javascript - RequireJS Mismatched anonymous define error caused by Drupal? -


i've had require.js app running on drupal site few months now. knowledge, nothing has changed in app's code, yesterday started getting following error:

uncaught error: mismatched anonymous define() module: 

interestingly, got same error when main.js file included following:

require.config({}); require([''], function() { }); 

but, when left main.js empty, got following error:

uncaught error: script error for: piwik 

piwik first js file included @ head of document.

i checked require.js documentation , found can caused loading require modules outside of require.js api. test if case ran app outside of drupal environment -- instead of loading in drupal template loading through external html file same markup drupal template file. in setup don't receive error , app loads expected.

so question is, there known conflicts drupal core javascript files , require.js? thing can imagine causing problem jquery (which included in document head) check see if define function , if defines jquery module... jquery loads before include require.js script.

i don't have other scripts containing "define", "require" or "module" on page.

i'm using current version of require (2.1.8) , latest drupal version (7.2.3)

alright -- i've solved above problem. kind of.

to debug problem, used "enforcedefine: false" in require.config. got error telling me 1 of required dependencies missing define function. checked , indeed case (seems have been caused new git commit). still mismatch error, @ least app loads.

further update:

ended being caused piwik's use of 'define'. apparently fixed in upcoming piwik version.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

mysql - Pass value between different pages (form) with PHP -