Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mute esbuild while parsing for NPM modules #497

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions node/npm_dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,22 +142,28 @@ export const vendorNPMSpecifiers = async ({
// loaded as npm dependencies, because they either use the `npm:` prefix or
// they are bare specifiers. We'll collect them in `specifiers`.
try {
await build({
const { errors, warnings } = await build({
banner,
bundle: true,
entryPoints: functions,
logLevel: 'error',
logLevel: 'silent',
nodePaths,
outdir: temporaryDirectory.path,
platform: 'node',
plugins: [getDependencyTrackerPlugin(specifiers, importMap.getContentsWithURLObjects(), pathToFileURL(basePath))],
write: false,
format: 'esm',
})
if (errors.length !== 0) {
logger.system('ESBuild errored while tracking dependencies in edge function:', errors)
}
if (warnings.length !== 0) {
logger.system('ESBuild warned while tracking dependencies in edge function:', warnings)
}
} catch (error) {
logger.system('Could not track dependencies in edge function:', error)
logger.user(
'An error occurred when trying to scan your edge functions for npm modules, which is an experimental feature. If you are loading npm modules, please share the errors above in https://ntl.fyi/edge-functions-npm. If you are not loading npm modules, you can ignore this message.',
'An error occurred when trying to scan your edge functions for npm modules, which is an experimental feature. If you are loading npm modules, please share the link to this deploy in https://ntl.fyi/edge-functions-npm. If you are not loading npm modules, you can ignore this message.',
)
}

Expand Down