-
Notifications
You must be signed in to change notification settings - Fork 268
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
Error: Mismatched anonymous define() module thrown by RequireJS #31
Comments
Can you provide a reproducible demo for the error? The following code works fine for me: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>demo</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.js"></script>
</head>
<body>
<script>
require(['https://buttons.github.io/buttons.js'], function (GitHubButtons) {
GitHubButtons.render()
});
</script>
</body>
</html> |
|
@mjurowicz-xsolve Ok. Now I see what you mean by use |
Ok, will use this solution. Maybe it could be added to the README? |
I've updated the README, and following is a more detailed explanation: The error is caused by loading an anonymous AMD module as a Why don't we just make it a named module instead of an anonymous one? Because the same script works as either a vanilla JS or a module, but those two options have different default behavior:
So, when including |
When i'm trying to use
https://buttons.github.io/buttons.js
together withhttps://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.js
i'm getting the:The text was updated successfully, but these errors were encountered: