Skip to content
This repository was archived by the owner on Oct 23, 2025. It is now read-only.
This repository was archived by the owner on Oct 23, 2025. It is now read-only.

Unable to use in a pure-JS project #117

@steelbrain

Description

@steelbrain

tsr@1.3.4 when you import it like import tsr from 'tsr' then it gets imported from node_modules/tsr/dist/main.js, which has this on the first line import { tsr, Config } from "./tsr.js";

Config is only exported from the Typescript definition file, not from the js file, so import fails. Here's the raw error from nodejs

file:///.../node_modules/tsr/dist/main.js:1
import { tsr, Config } from "./tsr.js";
              ^^^^^^
SyntaxError: The requested module './tsr.js' does not provide an export named 'Config'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:177:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:260:5)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:543:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5)

Node.js v22.11.0

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