Skip to content

Import error when using node + tsc #174

@ex-daniel-graupner

Description

@ex-daniel-graupner

I installed ventojs via npm. My project uses nodejs v22.17 and typescript.

tsconfig includes the following compiler options:

{
  "compilerOptions": {
    "declaration": false,
    "importHelpers": true,
    "module": "Node16",
    "moduleResolution": "node16",
    "target": "es2022",
    "outDir": "dist",
    "rootDir": ".",
    "strict": true,
    "esModuleInterop": true,
    "sourceMap": true,
    "forceConsistentCasingInFileNames": true
  }

I just added file VentoTest.ts with one line: import vento from "ventojs".

Compiling with tsc throws errors:

node_modules/ventojs/types/core/environment.d.ts:1:23 - error TS2846: A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file './tokenizer.js' instead?

1 import { Token } from "./tokenizer.d.ts";
                        ~~~~~~~~~~~~~~~~~~

node_modules/ventojs/types/mod.d.ts:1:42 - error TS2846: A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file './core/environment.js' instead?

1 import { Environment, type Loader } from "./core/environment.d.ts";
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~

How can I use ventojs with node + typescript?

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