Skip to content
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

Different output on local and production #33

Closed
udewilde opened this issue Oct 17, 2017 · 14 comments
Closed

Different output on local and production #33

udewilde opened this issue Oct 17, 2017 · 14 comments

Comments

@udewilde
Copy link

I have been using the module on my local machine and everything works perfectly.
However, when I moved to production, Typist.Backspace & Typist.Delay have completely stopped working.
I mean that the text will just be added to the previous one, without any rythme change.
The output is just one big string

<Typist onCharacterTyped={this.someFunction} avgTypingDelay={150} startDelay={1000} >
    FOO
    <Typist.Backspace count={30} delay={3000}/>
    <Typist.Delay ms={3000} />
    BAR
</Typist>

//FOOBAR

If it can be any indicator, I noticed that on localhost when the Typist.Backspace occurs, this happens:

someFunction = (char, charIndex) => {
 console.log(char) // BACK (+ a right arrow on top)
};

But nothing is logged when in production.

Any idea what I am getting wrong?

Thanks

@elliotleelewis
Copy link

I have the exact same issue!

@udewilde
Copy link
Author

I'm running version 2.0.1
The app is hosted on firebase, so I am deploying to production with the firebase deploy command, with a react-create-app structure

@jstejada
Copy link
Owner

Ah, that's no good! Do you mind giving me the following information:

  • react-typist version (in your package.json)
  • react version (in your package.json)
  • if you are able to share, a description of your build process to production
  • if you are able to share, the site you deployed to which isn't working
  • any other info that might be useful to reproduce this scenario

Thank you!

@jstejada
Copy link
Owner

Thanks @udewilde! Do you mean create-react-app?

Do you know which versions of create-react-app, and react-scripts (should be in your package.json) you are using?

Thank you!

@udewilde
Copy link
Author

Sure! here are the relevant elements in my package.json

"dependencies": {
    "firebase": "^3.7.8",
    "react": "^15.5.4",
    "react-dom": "^15.5.4",
    "react-typist": "^2.0.1",
  },
  "devDependencies": {
    "react-scripts": "0.9.5",
    "sw-precache": "^5.2.0",
    "sw-precache-webpack-plugin": "^0.11.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build && cp manifest.json build/ && sw-precache --root='build/' --static-file-globs='build/**/!(*map*)'",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }

The build process is using the one described in the create-react-app, with a pre-cache addition to it.

Here is the link to the website. If you open the Chrome Devtools, you should see every char change logged in the console, as well as the char index.
In this instance, I am not displaying the <Typist> component, but I am using onCharacterTyped to update the state feeding the search bar placeholder.
However I've tried not updating any state whatsoever and just rendering the <Typist> component, but the output was the same.

@jstejada
Copy link
Owner

jstejada commented Oct 20, 2017

Awesome, thank you for all the info! 😊 This should help me reproduce and get to the bottom of this. I'll dive into this later this evening or tomorrow

Thanks again!

@elliotleelewis
Copy link

I'm using Laravel Mix, not create-react-app, so I don't think that this is solely related to create-react-app

@jstejada
Copy link
Owner

jstejada commented Oct 21, 2017

thanks @elliotleelewis, @udewilde. I think I figured out what's going on: when the code is minified, this check no longer works: https://github.com/jstejada/react-typist/blob/master/src/utils.js#L42 because the Backspace Component is no longer called Backspace.

I'll push a fix soon

@jstejada
Copy link
Owner

I've released a fix with v2.0.3 (d122bd1), which should resolve your issue.

Let me know if that's not the case!

@udewilde
Copy link
Author

Hey @jstejada, I have just updated the module (2.0.3) , but I still get the same issue in production.
It's a new build and new push to production, so it is definitely not the old version running.
I have left the code with the issue in production, so you can see the output in the search bar placeholder.

@elliotleelewis
Copy link

Yeah I still have same issue too!

@jstejada
Copy link
Owner

Oh, yeah you're right! Sorry, that was my bad! It should be fixed in 2.0.4! @elliotleelewis @udewilde

@elliotleelewis
Copy link

elliotleelewis commented Oct 21, 2017

Works for me! 😃

@udewilde
Copy link
Author

Works for me too!
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants