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

"@symfony/ux-chartjs/package.json" could not be found #87

Open
Dumorya opened this issue Jan 15, 2024 · 2 comments
Open

"@symfony/ux-chartjs/package.json" could not be found #87

Dumorya opened this issue Jan 15, 2024 · 2 comments

Comments

@Dumorya
Copy link

Dumorya commented Jan 15, 2024

Hi,

When I launch the command npm run build, I get the following error:

`[xxx@serveur tag]$ /home/xxx/nodevenv/public_html/xxx/16/bin/npm run build

build
encore production --progress

Running webpack ...

99% done plugins FriendlyErrorsWebpackPlugin ERROR Failed to compile with 1 errors 12:44:04

error in ./assets/controllers.json 12:44:04

Module build failed (from ../../nodevenv/public_html/xxx/16/lib/node_modules/@symfony/stimulus-bridge/dist/webpack/loader.js):
Error: The file "@symfony/ux-chartjs/package.json" could not be found. Try running "yarn install --force".
at createControllersModule (/home/xxx/nodevenv/public_html/xxx/16/lib/node_modules/@symfony/stimulus-bridge/dist/webpack/loader.js:46:19)
at Object.loader (/home/xxx/nodevenv/public_html/xxx/16/lib/node_modules/@symfony/stimulus-bridge/dist/webpack/loader.js:106:43)

Entrypoint app = runtime.9a71ee5d.js 842.cb9a3ca0.js app.97de1fbb.css app.0095513b.js 7 auxiliary assets
webpack compiled with 1 error`

Indeed, I don't have the package.json file in the directory ux-chartjs.

Here is my package.json:

{ "devDependencies": { "@hotwired/stimulus": "^3.0.0", "@popperjs/core": "^2.11.0", "@symfony/stimulus-bridge": "^3.2.0", "@symfony/stimulus-bundle": "file:vendor/symfony/stimulus-bundle/assets", "@symfony/ux-chartjs": "file:vendor/symfony/ux-chartjs/assets", "@symfony/webpack-encore": "^1.7.0", "bootstrap": "^5.1.3", "chart.js": "^3.4.1", "core-js": "^3.20.0", "jquery": "^3.6.0", "regenerator-runtime": "^0.13.2", "sass": "^1.45.0", "sass-loader": "^12.4.0", "webpack-notifier": "^1.15.0" }, "license": "UNLICENSED", "private": true, "scripts": { "dev-server": "encore dev-server", "dev": "encore dev", "watch": "encore dev --watch", "build": "encore production --progress" }, "dependencies": { "@babel/plugin-proposal-class-properties": "^7.18.6" } }

Thank you,

Clara.

@HuyNguyen206
Copy link

I also facing this error. Any solution?

@Senpai-Codes
Copy link

from /vendor/symfony/ux-charts copy "assets" folder to node_modules/@symfony and rename it "ux-chartjs"
open node_modules/@symfony/ux-chartjs in terminal
run npm install
from within node_modules/chart.js/dist copy chart.js to node_modules/@symfony/ux-chartjs/assets
now you can compile your JS
PS if you run another symfony UX install like composer require symfony/ux-cropperjs it will override your changes... its not real solution just get you going until it resolved correctly. 

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