I'm getting these errors:
X [ERROR] Could not resolve "term.js"
node_modules/.pnpm/[email protected]/node_modules/blessed/lib/widgets/terminal.js:93:22:
93 │ this.term = require('term.js')({
╵ ~~~~~~~~~
You can mark the path "term.js" as external to exclude it from the bundle, which will remove this
error and leave the unresolved path in the bundle. You can also surround this "require" call with
a try/catch block to handle this failure at run-time instead of bundle-time.
X [ERROR] Could not resolve "pty.js"
node_modules/.pnpm/[email protected]/node_modules/blessed/lib/widgets/terminal.js:218:21:
218 │ this.pty = require('pty.js').fork(this.shell, this.args, {
╵ ~~~~~~~~
You can mark the path "pty.js" as external to exclude it from the bundle, which will remove this
error and leave the unresolved path in the bundle. You can also surround this "require" call with
a try/catch block to handle this failure at run-time instead of bundle-time.
14:20:58 [vite] (client) error while updating dependencies:
Error: Build failed with 2 errors:
node_modules/.pnpm/[email protected]/node_modules/blessed/lib/widgets/terminal.js:93:22: ERROR: Could not resolve "term.js"
node_modules/.pnpm/[email protected]/node_modules/blessed/lib/widgets/terminal.js:218:21: ERROR: Could not resolve "pty.js"
at failureErrorWithLog (C:\Users\ethan\Desktop\Projects\fylo\website-v2\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1463:15)
at C:\Users\ethan\Desktop\Projects\fylo\website-v2\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:924:25
at C:\Users\ethan\Desktop\Projects\fylo\website-v2\node_modules\.pnpm\[email protected]\node_modules\esbuild\lib\main.js:1341:9
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
So I added this to my app config:
build: {
rollupOptions: {
external: ["pty.js", "term.js"]
}
}
But the errors still show. I don't use these packages however have reason to believe that they stem from a package I import in a file called pm2 which is a server-only package. I've also tried excluding pm2 but to no avail.