-
Notifications
You must be signed in to change notification settings - Fork 104
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
Examples from readme #304
Comments
Thank you for reporting.
It requires some investigation. Are you in the position to help?
…On Fri, 28 Apr 2017, 23:35 Michael H. ***@***.***> wrote:
Hello everyone,
sorry, but am I just blind/an idiot/dumb or aren't the examples found in
the readme working?
I installed stampit via bower via "bower install stampit" an have the
following code:
<script src="bower_components\stampit\stampit.js"></script>
<script>
// Some privileged methods with some private data.
const Availability = stampit().init(function() {
var isOpen = false; // private
....
When executing this in Chrome, it says:
Uncaught TypeError: stampit is not a function at stampit.html:5
But when typing "stampit" into Chrome Dev Tools console, it shows me that
stampit is available with all it's methods (compose, composers, conf ...).
So what the hell is wrong?
Thx in advance!
Regards,
Michael
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#304>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABjCLwMAlW95EPsRhM5qUza_az_g2edCks5r0esPgaJpZM4NLfpW>
.
|
@Mika83AC Where do you have these script tags? Both in the head? In case you include both at the same spot, chances are that your "app code" is executed before stampit script is loaded and parsed. However accessing it later in the console works ok. You can investigate this behavior in Network tab of developer tools. The safest path is load external scripts in head tag and your logic at the end of the body. |
@koresar Hm... I think I'm not in a position to help as I'm a JS and StampIt newbie ... :( Really have no idea what might be wrong. @FredyC Even this is not working for me. Here is my example done as I understood your advice:
Still the error "Uncaught TypeError: stampit is not a function at index.html:12". |
@Mika83AC Where did you actually get that stampit script? Is it freshly installed from bower or did you made a copy from somewhere? Can you please try this live URL instead? https://npmcdn.com/stampit@3.1.3/dist/stampit.umd.min.js |
@FredyC I freshly installed it via bower as described in the readme: "bower install stampit". This morning (before posting here) I performed a "bower update" to be sure to be on the latest version. Using the CDN link you posted results in the same error. I've put my "example" on my server so you can have a direct look at it: http://divelop.de/stampit/ As I'm using the latest Chrome, I don't think it can/will be a browser compatibility issue. |
I see, there seems to be some issue unrelated to your code indeed. Quick workaround is simply to call @koresar Once again there is exported object with |
Fixed with stampit v4. |
Hello everyone,
sorry, but am I just blind/an idiot/dumb or aren't the examples found in the readme working?
I installed stampit via bower via "bower install stampit" an have the following code:
When executing this in Chrome, it says:
Uncaught TypeError: stampit is not a function at stampit.html:5
But when typing "stampit" into Chrome Dev Tools console, it shows me that stampit is available with all it's methods (compose, composers, conf ...).
So what the hell is wrong?
Thx in advance!
Regards,
Michael
The text was updated successfully, but these errors were encountered: