spree_backend icon indicating copy to clipboard operation
spree_backend copied to clipboard

Could not resolve "@spree/dashboard" Yarn warning

Open mrbrdo opened this issue 2 years ago • 3 comments

I've started to get this warning (it says error but it's not fatal) upon starting bin/dev. I wasn't getting this initially (at least I think so), but it started showing up now. I believe the dashboard is external, if that is true, then should it be marked as such?

18:59:47 js.1   | yarn run v1.22.17
18:59:47 js.1   | $ esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets --watch
18:59:47 js.1   | ✘ [ERROR] Could not resolve "@spree/dashboard"
18:59:47 js.1   |
18:59:47 js.1   |     app/javascript/spree-dashboard.js:4:7:
18:59:47 js.1   |       4 │ import "@spree/dashboard"
18:59:47 js.1   |         ╵        ~~~~~~~~~~~~~~~~~~
18:59:47 js.1   |
18:59:47 js.1   |   You can mark the path "@spree/dashboard" as external to exclude it from the bundle, which will remove this error.

mrbrdo avatar Nov 07 '22 18:11 mrbrdo

Hi @mrbrdo

Have you run yarn add @spree/dashboard

MatthewKennedy avatar Nov 07 '22 18:11 MatthewKennedy

I did as the docs say:

bin/rails javascript:install:esbuild
# Install @spree/dashboard NPM package
bin/rails g spree:backend:install

mrbrdo avatar Nov 09 '22 12:11 mrbrdo

@mrbrdo can you please provide more details to replicate the issue. it seems to be the issue with package dependency. you can try this:- yarn add @spree/dashboard yarn build

also compile the assets rails assets:precompile

arvind4501 avatar Oct 17 '23 17:10 arvind4501