mostafaznv / nova-map-field

Spatial Map Fields for Laravel Nova
MIT License
42 stars 15 forks source link

Path issue with mix on fresh clone #5

Open wdelfuego opened 2 years ago

wdelfuego commented 2 years ago

I just forked this repo because I want to play around with adding a search field (let me know if this is something you've already finished 😄).

But I couldn't run npm run on the freshly cloned tool until I changed line 19 of its webpack.mix.js file from:

'../../../vendor/laravel/nova/resources/js/mixins/packages.js'

to:

'../../vendor/laravel/nova/resources/js/mixins/packages.js'

Before I made that change, I got errors of this type:

ERROR in ./resources/js/components/FormField.vue?vue&type=script&lang=js (./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/FormField.vue?vue&type=script&lang=js) 1:0-66
Module not found: Error: Can't resolve 'laravel-nova' in '/app/nova-components/nova-map-field/resources/js/components'
ERROR in ./resources/js/components/form-fields/MultiPolygonFormField.vue?vue&type=script&lang=js (./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/form-fields/MultiPolygonFormField.vue?vue&type=script&lang=js) 1:0-66
Module not found: Error: Can't resolve 'laravel-nova' in '/app/nova-components/nova-map-field/resources/js/components/form-fields'
ERROR in ./resources/js/components/form-fields/PointFormField.vue?vue&type=script&lang=js (./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/form-fields/PointFormField.vue?vue&type=script&lang=js) 1:0-66
Module not found: Error: Can't resolve 'laravel-nova' in '/app/nova-components/nova-map-field/resources/js/components/form-fields'
ERROR in ./resources/js/components/form-fields/PolygonFormField.vue?vue&type=script&lang=js (./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/form-fields/PolygonFormField.vue?vue&type=script&lang=js) 1:0-66
Module not found: Error: Can't resolve 'laravel-nova' in '/app/nova-components/nova-map-field/resources/js/components/form-fields'
webpack compiled with 4 errors

Not sure if this is an issue caused by custom paths on my system or yours, I'll gladly create a pull request for this change if you think it should be changed.

mostafaznv commented 2 years ago

Hi @wdelfuego

No, I didn't started this feature yet. But I'm going to start it tomorrow.

Anyway, as you said, this error is just because of difference of custom paths in my computer system and yours.

> app
> config
> ...
> packages/mostafaznv/nova-map-field
> vendor

As you can see, my local package is placed in that path and I'm using nova from that vendor (vendor of root folder) which is not correct 😁, but I'm OK with it for now.

wdelfuego commented 2 years ago

Good to know 👍

You don’t think it’d be better for the project to come in a directly runnable state? Imo it’d be a shame to lose contributor time to needless debugging when they’re first looking into the project.

mostafaznv commented 2 years ago

Yes, you are right.

But I developed this package in hurry to use it in one of my own projects. so I decided to keep it as simple as I can. In future versions, I will add more interesting features to it and I will fix that path issue.

And FYI, I started to work on Geocoder feature and I will release new version soon

wdelfuego commented 2 years ago

While this issue lives in the codebase, anyone who is possibly interested in forking/contributing will run into this bug by default and will have to investigate themselves.

Until the repo is fixed I'd at least leave this issue open so people who run into it can easily find the solution here.

mostafaznv commented 2 years ago

Issue reopened 😁

And I will fix it later. maybe 2 or 3 weeks later