-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Parsley is undefined when loading from minified file? #930
Comments
(I know see that the rawgit URLs are pointing to my fork but I didn't actually change anything and if I make them point to this repo there is no difference) |
I also see that window.Parsley is defined. It's just the AMD function argument which is undefined... |
Hi @Download, Parsley minified version removes all AMD definitions and other stuff. AMD is only used in dev in At @Wisembly we require parsley min file with AMD with requirejs shim and it does the job. WDYT? |
Hi @guillaumepotier , thanks for looking into this. I searched for AMD support for Parsley and found this issue, so I thought support had been added: Also, I see that at least some support for AMD is still in the minified file. It starts with: To make Parsley behave as expected (and have the I can make a PR if you think it would stand a chance of being accepted? |
I tried it out and adding |
Indeed. Thank you. Best |
I'm pretty new to AMD / require.js as well as to Parsley, so excuse me if this turns out to be a user error...
I'm loading Parsley through AMD using require.js, but for some reason I'm getting
undefined
as the Parsley object.Here is the strange thing: If I load the source file of Parsley (I have to add some paths so it can find it's own sub modules) it does work!
I created a JS Fiddle that demonstrates my issue, but for some reason I could only get this to work using
require
. In my actual code I'm usingdefine
Here is my code using the minified script:
If I use the source version of Parsley, it does work:
If I leave out the dependency on jQuery, like so:
I get two errors:
I think this is a bug.
en.js
andpubsub.js
shoulddefine
themselves and declare the dependency on jQuery...If I add the explicit dependency on jQuery to the define using the minified Parsley, it doesn't actually help. Neither does adding the paths for
i18n
andvalidator
. Am I doing something wrong?The text was updated successfully, but these errors were encountered: