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?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • javascript
  • DreamBathrooms
  • mdbf
  • tacticalgear
  • magazineikmin
  • thenastyranch
  • rosin
  • everett
  • Youngstown
  • khanakhh
  • slotface
  • ngwrru68w68
  • kavyap
  • cisconetworking
  • InstantRegret
  • megavids
  • osvaldo12
  • GTA5RPClips
  • ethstaker
  • tester
  • Durango
  • normalnudes
  • anitta
  • modclub
  • cubers
  • Leos
  • provamag3
  • JUstTest
  • lostlight
  • All magazines