javascript
JavaScript minorsecond 1 year ago 100%

How to fix failed to resolve ol/control/Control from path error

I'm working on a personal project, https://www.packetradiomap.com. I need to npm install and npm run build but I'm getting this error:

@parcel/core: Failed to resolve ol/control/Control from ./node_modules/sidebar-v2/js/ol5-sidebar.js

I'm using this package: https://github.com/Turbo87/sidebar-v2 in my project, along with OpenLayers 5.4.

Previously, to get sidebar to work with OL, I've had to add this line to node_modules/ol/control.js:

export {default as Sidebar} from 'sidebar-v2/js/ol5-sidebar.js';

That would get things working. But now, I get the error mentioned in the title:

`@parcel/core: Failed to resolve 'ol/control/Control' from './node_modules/sidebar-v2/js/ol5-sidebar.js'

C:\Users\username\WebstormProjects\PacketMap\node_modules\sidebar-v2\js\ol5-sidebar.js:2:21
1 | // JS imports

2 | import Control from 'ol/control/Control';
| ^^^^^^^^^^^^^^^^^^^^
3 |
4 | export default class Sidebar extends Control {`

ol/control/Control definitely exists. Does something need to be changed?

2
0
Comments 0