bug: examples/next-server - Next Js Error on startup
Closed this issue · 4 comments
kendelljoseph commented
System Info
"@xenova/transformers": "^2.4.2",
"autoprefixer": "10.4.14",
"eslint": "8.45.0",
"eslint-config-next": "13.4.12",
"next": "^13.5.4",
"postcss": "^8.4.31",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.3"
Using the default next-server example.
Using pnpm i
Environment/Platform
- Website/web-app
- Server-side (e.g., Node.js, Deno, Bun)
Description
Then start typing in the input.
After the app is initialized, this is error occurs after visiting the site at the designated port.
Thank you @xenova for everything you do for open source ML and AI. We appreciate you!
Reproduction
Start: From the main transformers.js folder
- cd examples/next-server
- pnpm i
- pnpm dev
- go to localhost:3000
- start typing
kendelljoseph commented
I've tried adding what I think are the external packages responsible for the error to an opt-out list but the error persists.
I followed the advice from Next found here:
serverExternalPackages
examples/next-server/next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
// (Optional) Export as a standalone site
// See https://nextjs.org/docs/pages/api-reference/next-config-js/output#automatically-copying-traced-files
output: 'standalone', // Feel free to modify/remove this option
// Indicate that these packages should not be bundled by webpack
experimental: {
serverComponentsExternalPackages: ['sharp', 'onnxruntime-node'],
},
// I ADDED THIS
serverExternalPackages: ['@xenova/transformers', 'onnxruntime-node', 'node-loader'],
};
kendelljoseph commented
kendelljoseph commented
I'm seeing here that you called this out as a pnpm
issue.
#210 (comment)
I'll start over and try this again with npm or yarn...
kendelljoseph commented
- delete
node_modules
- installed using
yarn install
- yarn dev
now it works
Definitely still not supported using pnpm
.
Thanks @xenova !