Skip to content

Error: Can't resolve 'ol/Feature.js' using react-scripts without TypeScript #244

Description

@brianbancroft

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions