Skip to content

[Bug] @deck.gl-community/editable-layers missing @turf/rhumb-* dependencies #259

@dulldrums

Description

@dulldrums

Module

  • deck.gl-community/arrow-layers
  • deck.gl-community/bing-maps
  • deck.gl-community/editable-layers
  • deck.gl-community/experimental
  • deck.gl-community/graph-layers
  • deck.gl-community/layers
  • deck.gl-community/react
  • deck.gl-community/react-graph-layer

Description

I ran into this bug while trying to build a project that uses pnpm as a package manager, and it has hoisting disabled.

See the attached error message.

After investigation, it appears that the file translate-from-center.ts is importing @turf/rhumb-bearing, @turf/rhumb-distance, and @turf/rhumb-destination. These are all missing from @deck.gl-community/editable-layers's package.json.

As I have an easy means to test this fix out, I'm happy to make the changes and PR.

Expected Behavior

The project should build!

Steps to Reproduce

I just managed to replicate this in a private repository, and due to it's nature it might be difficult to setup on codepen/replit/etc. I'm happy to create a replicate public repo if required.

  • Create new project that uses pnpm
  • Set up pnpm to disable hoisting
  • Add @deck.gl-community/[email protected] as a dependency
  • pnpm install
  • tsc && vite build

Environment

Logs

error during build:
[vite]: Rollup failed to resolve import "@turf/rhumb-bearing" from "/Users/dulldrums/workspace/deck.gl-community-pnpm-test/node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_xelhxzf37u2tgjh3d3owfuqq54/node_modules/@deck.gl-community/editable-layers/dist/utils/translate-from-center.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
    at viteWarn (file:///Users/dulldrums/workspace/deck.gl-community-pnpm-test/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-C6uTJdX2.js:65839:17)

My .npmrc for pnpm to disable hoisting:

hoist=false

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions