krux / postscribe

Asynchronously write javascript, even with document.write.
MIT License
986 stars 156 forks source link

does not work with websites using RequireJS #473

Closed wilkinho closed 6 years ago

wilkinho commented 6 years ago

http://jsfiddle.net/hjgj1mrh/

Javascript error "Mismatched anonymous define() module" is prompted because of RequireJS.

I am not familiar with those javascript module thing, but I tried to modify postscribe code (minified or non-minified) by adding module name in define() function. It fixes the mismatched error, but I still meet "Uncaught ReferenceError: postscribe is not defined" javascript error.

I suspect there is some conflict between the code of postscribe and requireJS.

I found the old version (1.1.2) postscribe in some old doc and it works: http://jsfiddle.net/cLzc8v7z/ (both minified and non-minified work)