You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> ../../node_modules/pg/lib/native/client.js:4:21: error: Could not resolve "pg-native" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time)
4 │ var Native = require('pg-native')
╵ ~~~~~~~~~~~
/Users/vieira/Code/f1/node_modules/esbuild/lib/main.js:1466
let error = new Error(`${text}${summary}`);
^
Error: Build failed with 1 error:
../../node_modules/pg/lib/native/client.js:4:21: error: Could not resolve "pg-native" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time)
at failureErrorWithLog (/Users/vieira/Code/f1/node_modules/esbuild/lib/main.js:1466:15)
at /Users/vieira/Code/f1/node_modules/esbuild/lib/main.js:1148:28
at runOnEndCallbacks (/Users/vieira/Code/f1/node_modules/esbuild/lib/main.js:1066:65)
at buildResponseToResult (/Users/vieira/Code/f1/node_modules/esbuild/lib/main.js:1146:7)
at /Users/vieira/Code/f1/node_modules/esbuild/lib/main.js:1253:14
at /Users/vieira/Code/f1/node_modules/esbuild/lib/main.js:629:9
at handleIncomingPacket (/Users/vieira/Code/f1/node_modules/esbuild/lib/main.js:726:9)
at readFromStdout (/Users/vieira/Code/f1/node_modules/esbuild/lib/main.js:596:7)
at runServiceSync (/Users/vieira/Code/f1/node_modules/esbuild/lib/main.js:1831:3)
at Object.buildSync (/Users/vieira/Code/f1/node_modules/esbuild/lib/main.js:1651:3)
I should note that I am using npm7 workspaces and that pg-native is a dependency of a dependency of another package in the workspace, if I add the dependency directly to the package.json of the package I am trying to run it works (the externals computation finds it).
The text was updated successfully, but these errors were encountered:
The reason is that we take all deps and devdeps from your package.json and put those as externals. I'll change it so you can additionally pass in any other externals as you do right now.
Hello,
I tried defining
pg-native
as an external dependency but it seems the option is ignored, i.e., not being merged with the computed externals here:esbuild-runner/src/esbuild.ts
Line 94 in 5f005db
My
esbuild-runner.config.js
:and the error that is produced when running:
I should note that I am using npm7 workspaces and that
pg-native
is a dependency of a dependency of another package in the workspace, if I add the dependency directly to thepackage.json
of the package I am trying to run it works (theexternals
computation finds it).The text was updated successfully, but these errors were encountered: