-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
langchain.js module issue #2092
Comments
Answer generated by a 🤖 AnswerI understand that you're encountering an issue with the To resolve this issue, you can replace the import("llama-node/dist/extensions/langchain.js").then(langchain_js_1 => {
// You can use langchain_js_1 here
}); However, since you're using TypeScript, you might prefer to use import * as langchain_js_1 from "llama-node/dist/extensions/langchain.js"; Please note that this solution might require you to adjust your {
"compilerOptions": {
"outDir": "./dist",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": false,
"skipLibCheck": true,
"target": "esNext",
"module": "ESNext",
"lib": ["ESNext"]
},
"exclude": ["node_modules"]
} This is one potential solution to your problem. If you find that this solution works and you believe it's a bug that could impact other users, I encourage you to make a pull request to help others who might encounter the same issue. If this solution doesn't align with your experience, I recommend checking if you're using the latest version of the software, as the issue might have been resolved in a more recent update. SourcesThis response is meant to be useful, save you time, and share context. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. |
Hey @Pavel-Piha - apologies for the delay! I have this set as my
Could you try this to get yourself unblocked? I'll try to repro with your config. |
Wasn't able to repro with your setup - can you show how you're trying to import things? |
Try importing dynamically like the example below:
|
Has anyone found a fix for this using |
So I've just set up a brand new project and it looks like specifically Can you try with a fresh project and the following config (note
|
@jacoblee93 We have NestJS on backend, that comes with a specific tsconfig, if we switch it to type:"module" in package.json it won't work. There's a thread about this here nestjs/nest#10267 |
I was able to work around this import issue in a
|
@mhuckstepp would you have a repo to see? I did try a similar setup but still get the |
@deeeed Here is my setup
|
I faced the same issue, while using import in my TS project. I tried using tsc, ts-node and nodemon, but none of those worked, however I was able to make it work with tsx. |
🤖 The error you're encountering, In your To resolve this issue, you can try one of the following solutions:
Please note that if you're using TypeScript, you'll need to adjust your This issue has been encountered before in the langchainjs repository. You can refer to the issue #3662 and the corresponding pull request #3670 for more details. As for the purpose of the I hope this helps! If you have any more questions or need further clarification, feel free to ask. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Could someone suggest me how to to make it work?
I want to use Typescript and ES6 modules in my project
here is my tsconfig.json
The text was updated successfully, but these errors were encountered: