apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
60.36k stars 13.02k forks source link

Module not found: Error: Can't resolve 'currencyformatter.js' #21799

Open NishantSinghChandel opened 1 year ago

NishantSinghChandel commented 1 year ago

A clear and concise description of what the bug is. I am getting module not found error, when running without docker, setting up backend and frontend as mentioned in contributing.md.

How to reproduce the bug

  1. Local setup using contibuting.md, Running superset using proxy server followed instructions on contibuting.md. ,
  2. After setting up reverse proxy server, i tried to run npm run dev-server
  3. I got the above error with black screen. After closing this the project is working as expected, but on refresh the error shows up again.
  4. See error Screenshot 2022-10-13 at 12 48 59 PM

    Expected results

what you expected to happen. It must run without showing black screen full of error.

Actual results

what actually happens. It shows black screen.

Screenshots

If applicable, add screenshots to help explain your problem. Added above

Environment

(please complete the following information):

Checklist

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

Additional context

Add any other context about the problem here.

SamarinDV commented 1 year ago

Hi! try to install currencyformatter.js into plugin\plugin-chart-handlebars npm install currencyformatter.js --save

NishantSinghChandel commented 1 year ago

It still happen after installing currencyformatter.js @SamarinDV. Reopening again.

NishantSinghChandel commented 1 year ago
Screenshot 2023-02-07 at 4 50 55 PM

To Fix the issue I goto the same path as error and change currencyFormatter.js to currency-formatter. And the error popup vanish. PATH - ./plugins/plugin-chart-handlebars/node_modules/just-handlebars-helpers/lib/helpers/formatters.js step1: cd superset-frontend/plugins/plugin-chart-handlebars/node_modules/just-handlebars-helpers/lib/helpers/ step2: nano formatter.js step3: change currencyFormatter.js to currency-formatter.js as shown in ss.

Screenshot 2023-02-07 at 5 23 41 PM
abhiramvad commented 1 year ago

npm install currencyformatter.js --save

This works for me. Why is this not added to package.json if it's a required dependency?

rusackas commented 4 months ago

Is anyone still facing this? Seems like a trivial problem to open a PR for this, but assuming it's long resolved.

lscheibel commented 2 months ago

Hi, no this is not resolved yet.

I can submit a PR later this week, but I would also like to discuss pinning the dependency versions in the package.json file as this is largely a symptom of inconsistent dependencies.

lscheibel commented 2 months ago

Actually nevermind, @NishantSinghChandel can you check if you ran npm install with the legacy-peer-deps flag enabled? It might be in your global NPM config (you can check with npm config ls). This would cause NPM to skip installing the peer-dependencies, resulting in the runtime errors above.

Davidkramer1999 commented 1 month ago

If you are using Docker for development you need to add voulme for plugin

x-superset-volumes: &superset-volumes
  # /app/pythonpath_docker will be appended to the PYTHONPATH in the final container
  - ./docker:/app/docker
  - ./superset:/app/superset
  - ./superset-frontend:/app/superset-frontend
  - /localpath/superset-plugin-chart-hello-world:/app/superset-frontend/plugins/superset-plugin-chart-hello-world
  - superset_home:/app/superset_home
  - ./tests:/app/tests