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

Problems using UMD version #99

kokujin opened this Issue Feb 10, 2018 · 2 comments


None yet
3 participants

kokujin commented Feb 10, 2018

Hi there!
I tried to get something up quickly to test Stimulus, so I decided to use the UMD version without a build system. Can someone point me to a full working example?

This is what I tried, it emitted an error, "Uncaught SyntaxError: Unexpected token = ". I am using Chrome version 63, so ES6 syntax should not be an issue.


 <script src="/node_modules/stimulus/dist/stimulus.umd.js"></script>

        (function() {
            const application = Stimulus.Application.start();

            class Hello extends Stimulus.Controller {
                static targets = ["name"] // <-- This seems to be problematic
                greet() {
                    console.log(`Hello, ${}!`)

                get name() {
                    return this.nameTarget.value

            application.register("hello", Hello)


This comment has been minimized.


javan commented Feb 10, 2018

The Stimulus Discourse community forum is a good place for questions like this. See

@javan javan closed this Feb 10, 2018


This comment has been minimized.

bdavidxyz commented Feb 11, 2018

Yes, it is a bug since the StimulusJS docs suggest to use the umd, and the example "as is", which does not work. Docs should be updated with a possible solution to the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment