jspsych / jspsych-contrib

An open repository of jsPsych plugins and extensions, without any official support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't load the plugin - is unpkg down?

DominiqueMakowski opened this issue · comments

It seems like running:

<!DOCTYPE html>
<html>
    <head>
        <!-- Title shown in tab -->
        <title>Test</title>
        <script src="https://unpkg.com/jspsych@7.3.4"></script>
        <link href="https://unpkg.com/jspsych/css/jspsych.css" rel="stylesheet" type="text/css" />
        <script src="https://unpkg.com/@jspsych-contrib/plugin-survey-slider"></script>
    </head>

    <body></body>

    <script>
        var jsPsych = initJsPsych()

        jsPsych.run({
            type: jsPsychSurveySlider,
            questions: [{ prompt: "How old are you?" }],
        })
    </script>
</html>

Fails (i.e., it says that jsPsychSurveySlider is undefined. Tried different variant URLs like:

<script src="https://unpkg.com/@jspsych-contrib/plugin-survey-slider@1.0.0"></script> and
<script src="https://unpkg.com/jspsych-contrib/plugin-survey-slider@1.0.0"></script>

Am I doing something wrong or is this a larger issue?


Also, there is an typo in the plugin's README, there is no closing /script statement

Hi @DominiqueMakowski, this link is working for me:

https://unpkg.com/@jspsych-contrib/plugin-survey-slider@1.0.0

If you're not sure, you can always check by entering the URL directly in the browser. Is that one working for you now?

Another possible reason for that 'jsPsychPluginName is undefined` error would be if you typed the plugin name incorrectly, but it looks correct to me.

Thanks for pointing out the missing script closing tab in the plugin's README. It looks like most packages are missing that, so probably needs to be fix in our docs/templates. @jodeleeuw would you like me to do that?

Indeed it works now, I think yesterday morning unpkg was down because we had issues across multiple experiments, but it seems fixed now. cheers!

Thanks for pointing out the missing script closing tab in the plugin's README. It looks like most packages are missing that, so probably needs to be fix in our docs/templates. @jodeleeuw would you like me to do that?

That would be great @becky-gilbert !