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

Javascript Tooltip Generator error in deck.gl Scatterplot in superset version 3.0.1 #25871

Closed
3 tasks done
sergio-misa-imatia opened this issue Nov 6, 2023 · 13 comments
Closed
3 tasks done

Comments

@sergio-misa-imatia
Copy link

A clear and concise description of what the bug is.

How to reproduce the bug

  1. Create a deck.gl Scatterplot chart
  2. Edit Javascript Tooltip Generator. Simple example: d => <div>Hello</div>
  3. Hover dot in map
  4. See error

Expected results

An tooltip should appear displaying the text 'Hello'.

Actual results

Error inesperado
Ocurrió un error al crear la visualización: Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=EvalError%3A%20Refused%20to%20evaluate%20a%20string%20as%20JavaScript%20because%20'unsafe-eval'%20is%20not%20an%20allowed%20source%20of%20script%20in%20the%20following%20Content%20Security%20Policy%20directive%3A%20%22script-src%20'self'%20'strict-dynamic'%20'nonce-7YhSVYVgXPwTb47yYC7dn0ioWx2nmvJv'%22.%0A&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

If I use the Google Content-Security-Policy extension, this error does not occur, and the tooltip is displayed correctly, but I need a solution that doesn't involve using the Google extension.

Screenshots

image

Environment

(please complete the following information):

  • browser type and version:
  • superset version: 3.0.1
  • python version: 2.7.16`
  • node.js version: v16.19.0
  • any feature flags active: FEATURE_FLAGS = {"ALERT_REPORTS": True, "ENABLE_JAVASCRIPT_CONTROLS":True, "DASHBOARD_RBAC":True}

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.
@mike-fischer1
Copy link

Having same issue.

@mike-fischer1
Copy link

Any progress?

@sergio-misa-imatia
Copy link
Author

No :(
I still have the same problem.

@mike-fischer1
Copy link

yeah, this is still a problem. Can someone please fix

@mike-fischer1
Copy link

any updates?

@dkrat7
Copy link
Contributor

dkrat7 commented Jan 22, 2024

I tested JS tooltip in the 3.1.0 release and it works. I disabled superset security features for test (Talisman, html sanitization).

@mike-fischer1
Copy link

I just tested with 3.1.0 same error.

@dkrat7
Copy link
Contributor

dkrat7 commented Feb 1, 2024

It works like this:
d => '<div>Hello</div>'

jstooltip.mp4

@cisco90
Copy link

cisco90 commented Feb 23, 2024

I'm using v3.1.0
chart type DECK.GL POLYGON

on JavaScript tooltip generator
d => '<div>Hello</div>'
set HTML_SANITIZATION= false

and still not working

EDIT:
in order to solve this issue I set bot

HTML_SANITIZATION = False
TALISMAN_ENABLED = False

@s33k3rs
Copy link

s33k3rs commented Feb 27, 2024

It's fine for me in superset version: 3.1.0 or maybe in another version

  1. Add "ENABLE_JAVASCRIPT_CONTROLS": True into FEATURE_FLAGS in superset_config.py
  2. Add edit "'unsafe-eval'" into TALISMAN_CONFIG in config.py

2024-02-27_23-38-53

2024-02-27_23-43-07

@rusackas
Copy link
Member

Based on the comment above (thanks @s33k3rs) it seems like things are working in the latest version with proper config. Calling this closed, but we can re-open if warranted, or people can create new issues with updated context. Thanks!

@salvatorecolori
Copy link

Hi there, sorry for my support request.
I'm trying to use javascript tooltips con deck.gl heatmap and other deck.gl chart, but it works only on scatterplot chart. Using js tooltips on deck.gl heatmap, produce an "javascript Uncaught TypeError: Cannot read properties of undefined (reading 'extraProps')".
Extra fields are correctly filled in. If I copy-paste js tooltips code from Scatter to Heatmap, I receive the error.
Talisman is set as FALSE.

@lgz192
Copy link

lgz192 commented Feb 14, 2025

Good friend, have you found a solution? I also encountered this problem in 4.1.1, the extraPropsa property does not exist in the Javascript Tooltip Generator of heatmap

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

8 participants