Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Apr 10, 2023
1 parent 9fd3a6c commit fc0f5ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
13 changes: 0 additions & 13 deletions langchain/scripts/create-entrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,23 +216,10 @@ const updateConfig = () => {
require: `./${key}.cjs`,
};

// If there is a *.lite.js file add it as the root `import` export,
// which should/will then be used by non-Node environments.
const litePath = `./dist/${entrypoints[key]}.lite.js`;

if (deprecatedNodeOnly.includes(key)) {
entryPoint = {
node: entryPoint,
};
} else if (fs.existsSync(litePath)) {
const { types, ...rest } = entryPoint;
entryPoint = {
types,
node: rest,
import: litePath,
require: `./dist/${entrypoints[key]}.lite.cjs`,
default: litePath,
};
}

return [key === "index" ? "." : `./${key}`, entryPoint];
Expand Down
3 changes: 2 additions & 1 deletion test-exports-vercel/src/pages/api/hello-edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export default async function handler(req: NextRequest) {
]),
});

// Run the chain but don't await it
// Run the chain but don't await it, otherwise the response will start
// only after the chain is done
chain.run("hello").catch(console.error);

return new NextResponse(stream.readable, {
Expand Down

0 comments on commit fc0f5ef

Please sign in to comment.