uber / nebula.gl

A suite of 3D-enabled data editing overlays, suitable for deck.gl
https://nebula.gl/
Other
686 stars 166 forks source link

[Bug] imports from sub-paths like `@deck.gl/layers/typed` are not valid #889

Open keller-mark opened 11 months ago

keller-mark commented 11 months ago

Describe the bug

Hi, I am using NebulaGL in my web application. I am running into issues when importing NebulaGL (directly or indirectly) in unit testing frameworks which execute code using NodeJS (vitest in particular) because there are imports from sub-paths which are not specified as exports of the corresponding package.

For example, there are many statements like

https://github.com/uber/nebula.gl/blob/b316c6348f2ddfdf819dd6128438b39c39fa6db7/modules/layers/src/layers/editable-path-layer.ts#L1

import { PathLayer, PathLayerProps } from '@deck.gl/layers/typed'; 

These import statements are not valid ESM because the package @deck.gl/layers does not specify a value for "./typed", which would look something like

"exports": {
  "./typed": ...
}

https://github.com/visgl/deck.gl/blob/c51d4376f5d6f5d0e626e22f30e5e8767349a36e/modules/layers/package.json

Actual Result

N/A

Expected Result

Expect imports to be valid, either by changing the imports here in NebulaGL

- import { PathLayer, PathLayerProps } from '@deck.gl/layers/typed';
+ import { PathLayer, PathLayerProps } from '@deck.gl/layers';

OR

by DeckGL making the change upstream to include the appropriate exports value in their package.json files.

Reproduce Steps

N/A

Screenshots

N/A

To Do List