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
ES2015 imports not working #210
Comments
@janusch beta 14 was broken. beta 15 should work. It should work without those |
Hi @rwwagner90,
Also Popper is not defined on window. Is there anything else I can try? |
@janusch I don't think it should be on the window. It should be bundled with Shepherd. It's possible our UMD output does not work with ES6 imports right now. |
I am using webpack@3 that should not be an issue. Thank you for your help! |
@janusch you should be able to have multiple tours, so that surprises me. |
@rwwagner90 you were right that isn't the issue. still getting this:
But first after the tour has already been started. It does show the first step before it blows up. |
Hi again @rwwagner90, When I change I tried importing shepherd.js from the src directory instead of the dist directory and then I am back to a similar error as I had in beta-14
Any idea on how we can solve this issue? |
@janusch I'm pretty sure the output just doesn't support ES2015 imports. We need to look into it. It's umd format, so you can use CJS, AMD, etc. just can't |
@rwwagner90 I think with the latest fixes from 7 days ago make it actually work.
That way it is possible to: One will need Popper on window again though. |
@janusch I think we want to make import Popper from 'popper.js';
import Shepherd from 'shepherd.js'; We have some things in flux right now, so I will release what is in master as the next beta, and hopefully it will help you for now. |
@janusch I published beta 16 earlier. Does it work for you? |
I just tried beta 16 and it works for me. The other caveat is to also do an import of the css theme file that you want: |
@rwwagner90 Thank you for the beta release. Things are working now. |
@elfenheart @janusch I released beta 17, in which I added |
@rwwagner90 Thank you for creating yet another beta. I think it was already working in beta-16. I could import it like this
There is one more issue. When I am building with create-react-app and webpack@3 an optimized production build i get an error:
However shepherd.js works just fine. Maybe I am not using evented.js? Thank you for your time! |
@janusch the link they give you tells you the issue. Apparently, it does not like ES6. It wants an ES5 build shipped. In that case, you should probably just use the |
@rwwagner90 Hey, |
@janusch the point of shipping a module, as far as I know, is to ship the vanilla ES6 modules. All others would use the |
Are you saying |
yes, from the issue referred above I digged down to that the current create-react-app does use an older version of uglifyjs. Until they upgrade people using create-react-app cannot use libraries that refer in the module field to an ES6 build. Thank you for the advice. This works perfectly now. Maybe the issue is resolved? |
it worked since beta-16 which was released after the issue appeared, though the commit fixing it was already in master ;) |
@janusch perhaps we should just remove the |
Yes, I think that would be the right thing to do for now. |
This isn't working for me with webpack 4 and shepherd.js beta-18, however, beta-17 is working fine using |
@anishpateluk the latest version is |
@rwwagner90 same issue with beta.35 |
@anishpateluk in beta 17 we were shipping |
Hi,
first of all thank you for maintaining this module. I am trying to upgrade from tether-shepard and lots of things have changed.
I have tried both with 2-beta.14 and 2-beta.15 and get two different errors depending on the version.
in 2-beta.14 i get an error
TypeError: __WEBPACK_IMPORTED_MODULE_1_shepherd_js___default.a.Tour is not a constructor
importing it like this:in 2-beta.15 i get the error:
TypeError: Popper is not a constructor
In
node_modules/shepherd.js/dist/js/shepherd.js:430
atthis.popper = new Popper(opts.element, this.el, popperOpts);
Any idea on what I am missing? Does Shepherd work when it is used within an es6 module?
Some advice would be greatly appreciated!
The text was updated successfully, but these errors were encountered: