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

String ref causing error in React 16.2 #63

Open
danieldpence opened this issue Apr 5, 2018 · 7 comments
Open

String ref causing error in React 16.2 #63

danieldpence opened this issue Apr 5, 2018 · 7 comments

Comments

@danieldpence
Copy link

I hope that I'm just doing something wrong, but I'm getting a pesky ref-related error and I think it's due to the distributed output containing a string ref:

In react-chartist/dist/index.js:
screen shot 2018-04-05 at 4 28 34 pm

The error I'm seeing in the console:
screen shot 2018-04-05 at 4 40 36 pm

Upon digging in, it looks like maybe the build step wasn't run again after the bump to 13.0? To confirm, I ran your build script locally and sure enough the transpiled output is what I would have expected:
screen shot 2018-04-05 at 4 46 57 pm

I'm happy to help any way I can, but I hope it's as simple as publishing a new build.

Thanks for your work on this package - I've used it a lot and it's great!

@kreppi92
Copy link

Did you define '_this2.chart' anywhere?

@danieldpence
Copy link
Author

@kreppi92 No - that's the generated, transpiled output produced by Babel.

@LashaunnaS
Copy link

Do you mind sharing a screenshot of your package.json @danieldpence ?

@danieldpence
Copy link
Author

@LashaunnaS : "react-chartist": "^0.13.1"

The problem is the compiled source code in the dist folder of the package is not current with v0.13.1 of the package. I suspect the maintainer did not run npm run build when they published the latest release to NPM.

You can reproduce this issue easily by:

  1. Install the latest version of this package (0.13.1)
  2. cd node_modules/react-chartist
  3. Inspect the dist/index.js file to see the first screen shot above.
  4. npm run build (this runs the source code through Babel and generates what you see in dist/index.js)
  5. Inspect the new dist/index.js file to see the corrected compiled version of the source as indicated by the second screenshot above.

@LashaunnaS
Copy link

That did the trick @danieldpence! Thanks so much for the help I am really looking forward to using this library.

For anyone who may need this thread moving forward the above steps were exactly what you needed. If you get an error after running step #4 run npm install then continue on from step #4 and that did the tick for me.

Cheers @danieldpence

@fraserxu
Copy link
Owner

Sorry for the inconvenience @LashaunnaS @danieldpence , I have just published the updated version to + react-chartist@0.13.2, let me know if it fixes the issue.

PS: I usually have prePublishOnly script hook to run build automatically for my other projects but this one somehow hasn't configured it yet, I will do it later.

@danieldpence
Copy link
Author

No worries - thanks @fraserxu!

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

4 participants