Skip to content

typechat does not take effect in vscode extension #251

Closed

Description

@7neves

There is no problem using typechat during the development process, but after packaging it through vsce package, it does not take effect.

Activity

  1. 7neves commented on Jun 13, 2024

    @7neves
    Author

    When I use

    import { createTypeScriptJsonValidator } from "typechat/ts"

    When imported, it will become

    const ts1 = require('typechat/ts');
    

    As a result, the package cannot be imported
    I manually modified the directory structure of typechat in node_moudles, moved the validate.js file in the typechat/dist/ts directory to the typechat/dist directory, and then used import { createTypeScriptJsonValidator } from "typechat" The problem is solved. Is there a problem with the configuration of tsconfig? Or is there something wrong somewhere else?

  2. DanielRosenwasser commented on Jun 18, 2024

    @DanielRosenwasser
    Member

    I'm not exactly sure what is going wrong (I'm not seeing what error you're hitting) - however, if you are using typechat/ts, my guess is that you need to find a way to bring the original source text of your .ts schema around as an asset. Depending on your bundler, there are different ways to achieve this. In many bundlers (like Vite), you can add ?raw to the path to import the contents as a string.

    import schema from './schema.ts?raw';
  3. robgruen commented on Nov 4, 2026

    @robgruen
    Contributor

    Closing this as stale. Also, please check out #456 , might help.

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

    Needs More InfoMore information is necessary before further actions are taken.QuestionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions