I am importing the langchain
library using the command:
import { OpenAI } from "langchain";
For some reason, I am getting an error from the browser saying:
Uncaught SyntaxError: '' literal not terminated before end of script
where it references the file index.js
in node_modules/langchain
. When I look at this file in VS Code, I see
export * from './dist/index.js'
but when I then display it once I run npm start
(with web-dev-server --node-resolve --open --watch
), the file looks like
export * from './dist/index.js
missing the final '
. What is going on?
I expect for the import to work as described in the documentation - https://hwchase17.github.io/langchainjs/docs/install
I am not sure if maybe my npm start
setup is wrong, or whether I need to actually build something. I am new to web development and have limited experience.
It might be the case that the web-dev-server
is causing issues, but this problem is very strange.