this post was submitted on 20 Jun 2023
3 points (100.0% liked)

JavaScript

32 readers
1 users here now

Place for discussing all things related to the Javascript. This category can be used to ask for help with specific problems, share tips and tricks for working with js, and discuss new developments and best practices in the world of Javascript programming.

founded 2 years ago
 

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?

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here