Dogstudio / highway

Highway - A Modern Javascript Transitions Manager
https://highway.js.org/
MIT License
1.43k stars 92 forks source link

Class constructor Transition/Renderer cannot be invoked without 'new' #33

Closed ivandaum closed 5 years ago

ivandaum commented 5 years ago

Hi guys,

I was trying to follow the dummy tutorial with Hightway to implement a simple transition between two pages, but I met the same issue as https://github.com/Dogstudio/highway/issues/6. I'm using Webpack 4 with the UglifyJs plugin.

For the record, I added a resolve with 'build/es5/highway.min.js' in my webpack, and even copied your babel configuration, but it don't seem to fix the issue (not a pro user of Webpack though).

Do you know why I meet this error? Anyway, Hightway looks great an I can't wait to implement it everywhere 🔥!

ThaoD5 commented 5 years ago

Hello @ivandaum can you provide us some more informations about your Highway version ? Maybe try an update of it in case your version is behind ?

Thanks for you input,

Thao

ivandaum commented 5 years ago

Hi @ThaoD5,

I'm currently using Higthway 2.0.8.

ThaoD5 commented 5 years ago

It could be interesting to have your webpack.config.js here so that we can maybe figure things out faster, would this be possible for you ?

ivandaum commented 5 years ago

My bad, I managed to understand what you meant in https://github.com/Dogstudio/highway/issues/6 and fixed it (I thought the es5 build was auto-implement with the alias)!

For those who, like me, has trouble to understand, it can be fix by adding the follow line in your webpack, after the exclude: /node_modules/ :

include: '/node_modules/@dogstudio/highway/build/es5/highway.js',

Anway, thanks a lot guys!

ThaoD5 commented 5 years ago

@ivandaum glad you found a solution for this, thanks for maybe enlightening other people that could have the same issue :)

Have a good day !

ghost commented 5 years ago

@ivandaum I found a better solution to your problem. In your case you exclude completely node_modules and if you add a new library you will have to add the new library in include.

I prefer to import the right file into javascript:

import Highway from '@dogstudio/highway/build/es5/highway.js';

In the documentation:

import Highway from '@dogstudio/highway';

:blush::wave: