Skip to content

Packages not specified as modules #188

@mattrunyon

Description

@mattrunyon

Description

Packages do not specify they are modules in their package.json files. This causes node to break if you try to import something like utils to use elsewhere (docs script, for example).

Since we only publish ESM for all packages (except code-studio and golden-layout), we should add type: "module" to our package.json files to indicate to Node that the .js extension is to be treated as ESModules and not CommonJS.

Steps to reproduce
Run the following script with Node 14 (saved as a js file)

const { GridUtils } = import('@deephaven/grid');
console.log(GridUtils);

or this saved as a mjs file

import { GridUtils } from '@deephaven/grid';
console.log(GridUtils);

Expected results

Console log of GridUtils object

Actual results

Errors about unexpected import/export or expecting module type CommonJS

Versions

  • Deephaven: 0.3.1
  • Node: 14.12.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions