Open fabrilallo opened 3 weeks ago
I have the same issue
ERROR in ./node_modules/vue3-openlayers/dist/vue3-openlayers.es.js 105:0-56
Module not found: Error: Can't resolve 'ol/events/condition' in '/Users/user/Documents/Projects/app/node_modules/vue3-openlayers/dist'
Did you mean 'condition.js'?
BREAKING CHANGE: The request 'ol/events/condition' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
@ ./src/vue/app.js 3:0-44 52:23-36
Describe the bug Hello everyone! I'm trying to integrate
vue3-openlayers
in my personal project. My stack is:I'm trying to run this code:
But i got this error:
Cannot find module '/Users/fabrizio/Documents/Projects/TechCompenso/Repositories/tech-compenso/node_modules/.pnpm/vue3-openlayers@10.0.1_ol-contextmenu@5.4.0_ol@9.2.4__ol-ext@4.0.18_ol@9.2.4__ol@9.2.4_vue@3.4.27_typescript@5.4.5_/node_modules/ol/Feature' imported from /Users/fabrizio/Documents/Projects/TechCompenso/Repositories/tech-compenso/node_modules/.pnpm/vue3-openlayers@10.0.1_ol-contextmenu@5.4.0_ol@9.2.4__ol-ext@4.0.18_ol@9.2.4__ol@9.2.4_vue@3.4.27_typescript@5.4.5_/node_modules/vue3-openlayers/dist/vue3-openlayers.es.js Did you mean to import "ol/Feature.js"?
If i edit manually the import in the build and append
.js
it works. I think it's something related to thetsconfig.json
orastro
build. Consider that astro use vite for the building phase. So i can also do some tweaks on vite in the astro configuration if it is necessary. These are respectively mytsconfig.json
andastro.config.mjs
:tsconfig.json
astro.config.mjs
// https://astro.build/config import vue from "@astrojs/vue";
// https://astro.build/config export default defineConfig({ site: "https://techcompenso.com", output: "server", integrations: [ tailwind(), mdx({ optimize: true, }), vue({ appEntrypoint: "/src/app.js" }), ], adapter: netlify(), });
├── ol-contextmenu@5.4.0 -> ./node_modules/.pnpm/ol-contextmenu@5.4.0_ol@9.2.4/node_modules/ol-contextmenu ├── ol-ext@4.0.18 -> ./node_modules/.pnpm/ol-ext@4.0.18_ol@9.2.4/node_modules/ol-ext ├── ol@9.2.4 -> ./node_modules/.pnpm/ol@9.2.4/node_modules/ol ├── vue@3.4.27 -> ./node_modules/.pnpm/vue@3.4.27_typescript@5.4.5/node_modules/vue └── vue3-openlayers@10.0.1 -> ./node_modules/.pnpm/vue3-openlayers@10.0.1_ol-contextmenu@5.4.0_ol@9.2.4__ol-ext@4.0.18_ol@9.2.4__ol@9.2.4_vue@3.4.27typescript@5.4.5/node_modules/vue3-openlayers