Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Leaflet] Error during installation #2105

Closed
Vastuney opened this issue Aug 29, 2024 · 11 comments · Fixed by #2199
Closed

[Leaflet] Error during installation #2105

Vastuney opened this issue Aug 29, 2024 · 11 comments · Fixed by #2199
Labels

Comments

@Vastuney
Copy link

Module build failed: Module not found:
"./vendor/symfony/ux-leaflet-map/assets/dist/map_controller.js" contains a reference to the file "@symfony/ux-map/abstract-map-controller".
This file can not be found, please check it for typos or update it if the file got moved.

"./vendor/symfony/ux-leaflet-map/assets/dist/map_controller.js" contains a reference to the file "leaflet/dist/leaflet.min.css".
This file can not be found, please check it for typos or update it if the file got moved.

@Kocal
Copy link
Collaborator

Kocal commented Aug 29, 2024

Hi, how did you installed UX Map Leaflet? Did you install UX Map aswell?

@Vastuney
Copy link
Author

Hi, how did you installed UX Map Leaflet? Did you install UX Map aswell?

That's right, I installed both libraries - I'm struggling with this again. Either I don't know something, or the error comes from the first line in the map_controllers.js file

import AbstractMapController from '@symfony/ux-map/abstract-map-controller';

should be

import AbstractMapController from '@symfony/ux-map/abstract_map_controller';

Works for me.

@Kocal
Copy link
Collaborator

Kocal commented Aug 29, 2024

Ah, looks like you are not using Symfony AssetMapper/ImportMap but Webpack Encore?

The component is experimental, so we can break things without worries.

I think we will need to update the following lines to use @symfony/ux-map/abstract_map_controller:

@nfreader
Copy link

nfreader commented Sep 1, 2024

👍 from me on this. I'm also using Encore and running into the same issue. I tried editing the referenced files locally but didn't have any luck (I'm not a big JS type).

@principis
Copy link

Ah, looks like you are not using Symfony AssetMapper/ImportMap but Webpack Encore?

The component is experimental, so we can break things without worries.

I think we will need to update the following lines to use @symfony/ux-map/abstract_map_controller:

* https://github.com/symfony/ux/blob/2.x/src/Map/assets/package.json#L12

* https://github.com/symfony/ux/blob/2.x/src/Map/src/Bridge/Leaflet/assets/src/map_controller.ts#L1-L2

* https://github.com/symfony/ux/blob/2.x/src/Map/src/Bridge/Google/assets/src/map_controller.ts#L10-L11

Still doesn't seem to work. The following does, but I'm not sure if it's compatible with AssetMapper:

import AbstractMapController from '@symfony/ux-map';

@smnandre
Copy link
Collaborator

smnandre commented Sep 8, 2024

I think we have a way to handle both WebpackEncore and AssetMapper syntax/descriptor :

"symfony": {
"controllers": {
"live": {
"main": "dist/live_controller.js",
"name": "live",
"webpackMode": "eager",
"fetch": "eager",
"enabled": true,
"autoimport": {
"@symfony/ux-live-component/dist/live.min.css": true
}
}
},
"importmap": {
"@hotwired/stimulus": "^3.0.0",
"@symfony/ux-live-component": "path:%PACKAGE%/dist/live_controller.js"
}
},

@smnandre
Copy link
Collaborator

smnandre commented Sep 8, 2024

I believe this is how we allow import LiveComponent from "@symfony/ux-live-component"

The other way could be to inline the abstract class during compilation/bundling ?

see: https://symfony.com/bundles/ux-live-component/current/index.html#working-with-the-component-in-javascript

@rrenteria-dev
Copy link
Contributor

I'm also facing this issue using symfony/ux-google-map and webpack encore.
Like @principis said, if i change the import statement from @symfony/ux-google-map/dist/map_controller.js

from

import AbstractMapController from '@symfony/ux-map/abstract-map-controller';

to

import AbstractMapController from '@symfony/ux-map';

it works

any suggestions?

thanks in advance

@Kocal
Copy link
Collaborator

Kocal commented Sep 23, 2024

I will take a look

@Kocal
Copy link
Collaborator

Kocal commented Sep 23, 2024

Good news coming soon 🤩

@Kocal
Copy link
Collaborator

Kocal commented Sep 23, 2024

PR opened #2199

@Kocal Kocal added the Map label Sep 23, 2024
@Kocal Kocal closed this as completed in 48c5fa1 Sep 24, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants