superset icon indicating copy to clipboard operation
superset copied to clipboard

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

Open NishantSinghChandel opened this issue 2 years ago • 8 comments

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):

  • browser type and version: Chrome Version 106.0.5249.119
  • superset version: superset version Superset 0.0.0-dev
  • python version: python --version Python 3.9.7
  • node.js version: node -v v16.17.0 (npm v8.15.0)
  • any feature flags active:

Checklist

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

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

Additional context

Add any other context about the problem here.

NishantSinghChandel avatar Oct 13 '22 09:10 NishantSinghChandel

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

SamarinDV avatar Nov 16 '22 19:11 SamarinDV

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

NishantSinghChandel avatar Feb 07 '23 11:02 NishantSinghChandel

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

NishantSinghChandel avatar Feb 07 '23 11:02 NishantSinghChandel

npm install currencyformatter.js --save

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

abhiramvad avatar May 21 '23 13:05 abhiramvad

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

rusackas avatar Mar 02 '24 18:03 rusackas

Hi, no this is not resolved yet.

  • plugin-chart-handlebars is missing dependency "currencyformatter.js" which is listed as a peer-dependency of "just-handlebars-helpers" here https://github.com/leapfrogtechnology/just-handlebars-helpers/blob/main/package.json
  • plugin-chart-word-cloud is missing dependency "global-box" as stated here https://www.npmjs.com/package/encodable

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 avatar Apr 16 '24 07:04 lscheibel

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.

lscheibel avatar Apr 20 '24 14:04 lscheibel

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
  

Davidkramer1999 avatar May 20 '24 06:05 Davidkramer1999