question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bundling fails on 2.21.0

See original GitHub issue

Bug description

After upgrading to 2.21.0 and running ESBuild to bundle, a new error occurs:

> ../../common/temp/node_modules/.pnpm/@prisma+client@2.21.0_prisma@2.21.0/node_modules/@prisma/client/runtime/index.js:24152:23: 
error: Could not resolve "_http_common" (mark it as external to exclude it from the bundle)
24152 │   var common = require("_http_common");

and

"var runtimeRequire = 
  typeof __webpack_require__ === 'function' ? 
     __non_webpack_require__ : require // eslint-disable-line"

How to reproduce

  1. Install Prisma and ESBuild using PNPM.
  2. Run prisma generate
  3. Run esbuild app.js --bundle --platform=node --target=node14
  4. See error

Expected behavior

Prior to 2.21.0 bundling was successful.

Prisma information

// Datasources
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

// Generators
generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["debian-openssl-1.1.x", "linux-musl", "windows", "darwin"]
}

ESBuild config

module.exports = {
  bundle: true,
  minify: false,
  format: "cjs",
  keepNames: true,
  sourcemap: true,
  platform: "node",
  logLevel: "error",
  target: ["node14"],
  external: ["fsevents"],
  outfile: "dist/run.js",
  entryPoints: ["src/index.ts"],
  metafile: false,
  loader: { ".prisma": "file" },
}

Environment & setup

  • OS: Windows
  • Database: Postgres
  • Node.js version: v14.16.0
  • Prisma version: v2.21.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:19
  • Comments:24 (11 by maintainers)

github_iconTop GitHub Comments

19reactions
doeicommented, Aug 15, 2021

With webpack 5, simply adding '_http_common' to an array in the externals build option wasn’t enough for me, I had to specify it this way:

{
  // ...
  externals: {
    "_http_common": "commonjs2 _http_common",
  }
}
19reactions
millspcommented, May 28, 2021

In your webpack.config.js, add externals: ['_http_common', 'encoding'],

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Mixed content error while loading bundle.js (Http/ Https)
remote: remote: remote: ERROR in bundle. js from UglifyJs remote: Unexpected token: name (urlParts) [(webpack)-dev-server/client?
Read more >
Apache camel 2.21.0 Release
Fixed an issue with Routing Slip and Dynamic Router when using context scoped error handler, could cause the error handler to become stopped....
Read more >
Error Report | Eclipse Plugins, Bundles and Products
Error Code: ... org.eclipse.emf.feature.group [2.21.0,3.0.0)' but it could not be found Cannot satisfy dependency: From: IBM ODM for Developers - Rule ...
Read more >
import dependencies on liferay 7.3.2-ga3 - Forums
2)error: package com.liferay.portal.security.pwd does not exist ... i try to deploy this in liferay 7.3.2-ga3 i have the error:Error while starting bundle: ...
Read more >
Releases - Docs - OpenVidu
OpenVidu Enterprise, On Premises, 2.21.0, Deploy ... openvidu-webcomponent, ZIP, 2.21.0, GitHub ... openvidu-browser : bundled size cut almost in half!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found