Skip to content

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

Description

@keller-mark

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

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

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

  • Add label and assign to milestone
  • Coding
  • Test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions