Skip to content

Module resolution failure for collection and uid helpers #1680

@daniser

Description

@daniser

Environment

  • OS: Windows 10
  • Node.js: v18.17.1
  • TypeScript: v5.2.2
  • Package Manager: Yarn v3.6.3
  • Bundler: Vite v4.4.9
  • IDE: PhpStorm 2023.2.1

Reproduction

Describe the bug

Neither TypeScript nor IDE cannot resolve collection/uid helpers:

error TS2307: Cannot find module 'pinia-orm/dist/helpers' or its corresponding type declarations.

87 import { useCollect } from "pinia-orm/dist/helpers";

Rollup is fine though.

In previous versions of Pinia ORM I just added .js at the end and it worked. With 1.7.0 release this hack stopped working for some reason.

Additional context

My tsconfig.json:

{
    "compilerOptions": {
        "allowJs": true,
        "module": "ESNext",
        "moduleResolution": "bundler",
        "jsx": "preserve",
        "strict": true,
        "isolatedModules": true,
        "target": "ESNext",
        "esModuleInterop": true,
        "resolveJsonModule": true,
        "experimentalDecorators": true,
        "forceConsistentCasingInFileNames": true,
        "noEmit": true,
        "skipLibCheck": true,
        "paths": {
            "@/*": ["./resources/js/*"]
        }
    },
    "include": [
        "resources/js/**/*.ts",
        "resources/js/**/*.d.ts",
        "resources/js/**/*.vue",
        "vite.config.ts"
    ]
}

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions