Skip to content

Autoimport from effect is not typed correctly #2384

Closed

Description

@rijenkii

Environment

Node: v20.12.2
Nitro: 2.9.6
Config:

export default defineNitroConfig({
  srcDir: "server",
  imports: {
    imports: [{ from: "effect", name: "Effect" }],
  },
});

Reproduction

https://github.com/rijenkii/nitro-effect-autoimport-bug

Describe the bug

After adding effect to autoimport, references of Effect in the project get assigned type any:
image

In .nitro/types/nitro-imports.d.ts row which imports Effect looks like this:

const Effect: typeof import('../../node_modules/effect/dist/esm/index')['Effect']

And it also contains the following error:

Could not find a declaration file for module '../../node_modules/effect/dist/esm/index'.
'/tmp/nitro-app/node_modules/effect/dist/esm/index.js' implicitly has an 'any' type. ts(7016)

Replacing esm in the line to dts fixes the problem, but it is rewritten on every generation.

Additional context

I've tried adding typeFrom: "../../node_modules/effect/dist/dts/index" to the import config as a temporary workaround, but it did not do anything: nitro-imports.d.ts still generates with effect/dist/esm/index.

Logs

No response

Activity

  1. changed the title [-]Autoimport from `effect` does not type correctly[/-] [+]Autoimport from `effect` is not typed correctly[/+] on Apr 20, 2024
  2. added
    bugSomething isn't working
    and removed on Sep 2, 2026
  3. pi0 commented on Sep 3, 2026

    @pi0
    Member

    Type gen is being removed from Nitro v3 (#4577)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingv2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions