brianbancroft · GitHub

This error occurs when using the app in a [non-typescript] create-react-app-setup. When I attempt to import the geojson module, I see the following error:

DependencyNotFoundError
Could not find dependency: 'ol' relative to '/node_modules/flatgeobuf/lib/mjs/ol/feature.js'

Issue goes away when I install ol, but this is not ideal because I am using this library for processes that do not involve openlayers.

Minimal Example

The following is a codesandbox, where I attempt to import the module.

https://codesandbox.io/s/epic-blackburn-0gexn3

Screen.Recording.2022-11-03.at.10.46.07.AM.mov

Desired behaviour

I would hope not to see this error or to require to install openlayers unless I am using the openlayers module.

Read the original on github.com ↗