Repository: vercel/next.js
Pull request: Set Turbopack env var for internal modules

Sets `process.env.TURBOPACK` globally when running with Turbopack. This is relied upon in some cases with internals, specifically with files that are not bundled in e.g. Pages Router. It should not be used by application code.

Closes PACK-4130

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the PR.
- Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to understand the PR)
- When linking to a Slack thread, you might want to share details of the conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->


Closes PACK-4289

Changed files:
filename: turbopack/crates/turbopack-ecmascript-runtime/js/src/nodejs/runtime.ts
patch: @@ -27,6 +27,8 @@ type SourceInfo =
       parentId: ModuleId;
     };
 
+process.env.TURBOPACK = '1';
+
 function stringifySourceInfo(source: SourceInfo): string {
   switch (source.type) {
     case SourceType.Runtime:

filename: turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js
patch: @@ -429,6 +429,7 @@ var SourceType = /*#__PURE__*/ function(SourceType) {
    */ SourceType[SourceType["Parent"] = 1] = "Parent";
     return SourceType;
 }(SourceType || {});
+process.env.TURBOPACK = '1';
 function stringifySourceInfo(source) {
     switch(source.type){
         case 0:

filename: turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map
patch: @@ -6,5 +6,5 @@
     {"offset": {"line": 337, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/base-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// <reference path=\"../shared/runtime-utils.ts\" />\n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: ModuleId) {\n  let raw\n  try {\n    raw = await import(id)\n  } catch (err) {\n    // TODO(alexkirsz) This can happen when a client-side module tries to load\n    // an external module we don't provide a shim for (e.g. querystring, url).\n    // For now, we fail semi-silently, but in the future this should be a\n    // compilation error.\n    throw new Error(`Failed to load external module ${id}: ${err}`)\n  }\n\n  if (raw && raw.__esModule && raw.default && 'default' in raw.default) {\n    return interopEsm(raw.default, createNS(raw), true)\n  }\n\n  return raw\n}\n\nfunction externalRequire(\n  id: ModuleId,\n  thunk: () => any,\n  esm: boolean = false\n): Exports | EsmNamespaceObject {\n  let raw\n  try {\n    raw = thunk()\n  } catch (err) {\n    // TODO(alexkirsz) This can happen when a client-side module tries to load\n    // an external module we don't provide a shim for (e.g. querystring, url).\n    // For now, we fail semi-silently, but in the future this should be a\n    // compilation error.\n    throw new Error(`Failed to load external module ${id}: ${err}`)\n  }\n\n  if (!esm || raw.__esModule) {\n    return raw\n  }\n\n  return interopEsm(raw, createNS(raw), true)\n}\n\nexternalRequire.resolve = (\n  id: string,\n  options?: {\n    paths?: string[]\n  }\n) => {\n  return require.resolve(id, options)\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAY;IACxC,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AAEA,SAAS,gBACP,EAAY,EACZ,KAAgB,EAChB,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM;IACR,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,KAAK;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B","ignoreList":[0]}},
     {"offset": {"line": 376, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\ndeclare var RUNTIME_PUBLIC_PATH: string;\ndeclare var RELATIVE_ROOT_PATH: string;\ndeclare var ASSET_PREFIX: string;\n\nconst path = require(\"path\");\n\nconst relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, \".\");\n// Compute the relative path to the `distDir`.\nconst relativePathToDistRoot = path.join(\n  relativePathToRuntimeRoot,\n  RELATIVE_ROOT_PATH\n);\nconst RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot);\n// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.\nconst ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot);\n\n/**\n * Returns an absolute path to the given module path.\n * Module path should be relative, either path to a file or a directory.\n *\n * This fn allows to calculate an absolute path for some global static values, such as\n * `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.\n * See ImportMetaBinding::code_generation for the usage.\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n  if (modulePath) {\n    return path.join(ABSOLUTE_ROOT, modulePath);\n  }\n  return ABSOLUTE_ROOT;\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAMpD,MAAM,OAAO,QAAQ;AAErB,MAAM,4BAA4B,KAAK,QAAQ,CAAC,qBAAqB;AACrE,8CAA8C;AAC9C,MAAM,yBAAyB,KAAK,IAAI,CACtC,2BACA;AAEF,MAAM,eAAe,KAAK,OAAO,CAAC,YAAY;AAC9C,mGAAmG;AACnG,MAAM,gBAAgB,KAAK,OAAO,CAAC,YAAY;AAE/C;;;;;;;CAOC,GACD,SAAS,oBAAoB,UAAmB;IAC9C,IAAI,YAAY;QACd,OAAO,KAAK,IAAI,CAAC,eAAe;IAClC;IACA,OAAO;AACT","ignoreList":[0]}},
     {"offset": {"line": 396, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared-node/node-wasm-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// <reference path=\"../shared/runtime-utils.ts\" />\n\nfunction readWebAssemblyAsResponse(path: string) {\n  const { createReadStream } = require(\"fs\") as typeof import(\"fs\");\n  const { Readable } = require(\"stream\") as typeof import(\"stream\");\n\n  const stream = createReadStream(path);\n\n  // @ts-ignore unfortunately there's a slight type mismatch with the stream.\n  return new Response(Readable.toWeb(stream), {\n    headers: {\n      \"content-type\": \"application/wasm\",\n    },\n  });\n}\n\nasync function compileWebAssemblyFromPath(\n  path: string\n): Promise<WebAssembly.Module> {\n  const response = readWebAssemblyAsResponse(path);\n\n  return await WebAssembly.compileStreaming(response);\n}\n\nasync function instantiateWebAssemblyFromPath(\n  path: string,\n  importsObj: WebAssembly.Imports\n): Promise<Exports> {\n  const response = readWebAssemblyAsResponse(path);\n\n  const { instance } = await WebAssembly.instantiateStreaming(\n    response,\n    importsObj\n  );\n\n  return instance.exports;\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,SAAS,0BAA0B,IAAY;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,QAAQ;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ;IAE7B,MAAM,SAAS,iBAAiB;IAEhC,2EAA2E;IAC3E,OAAO,IAAI,SAAS,SAAS,KAAK,CAAC,SAAS;QAC1C,SAAS;YACP,gBAAgB;QAClB;IACF;AACF;AAEA,eAAe,2BACb,IAAY;IAEZ,MAAM,WAAW,0BAA0B;IAE3C,OAAO,MAAM,YAAY,gBAAgB,CAAC;AAC5C;AAEA,eAAe,+BACb,IAAY,EACZ,UAA+B;IAE/B,MAAM,WAAW,0BAA0B;IAE3C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,UACA;IAGF,OAAO,SAAS,OAAO;AACzB","ignoreList":[0]}},
-    {"offset": {"line": 417, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/runtime.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// <reference path=\"../shared/runtime-utils.ts\" />\n/// <reference path=\"../shared-node/base-externals-utils.ts\" />\n/// <reference path=\"../shared-node/node-externals-utils.ts\" />\n/// <reference path=\"../shared-node/node-wasm-utils.ts\" />\n\nenum SourceType {\n  /**\n   * The module was instantiated because it was included in an evaluated chunk's\n   * runtime.\n   */\n  Runtime = 0,\n  /**\n   * The module was instantiated because a parent module imported it.\n   */\n  Parent = 1,\n}\n\ntype SourceInfo =\n  | {\n      type: SourceType.Runtime;\n      chunkPath: ChunkPath;\n    }\n  | {\n      type: SourceType.Parent;\n      parentId: ModuleId;\n    };\n\nfunction stringifySourceInfo(source: SourceInfo): string {\n  switch (source.type) {\n    case SourceType.Runtime:\n      return `runtime for chunk ${source.chunkPath}`;\n    case SourceType.Parent:\n      return `parent module ${source.parentId}`;\n    default:\n      invariant(source, (source) => `Unknown source type: ${source?.type}`);\n  }\n}\n\ntype ExternalRequire = (\n  id: ModuleId,\n  thunk: () => any,\n  esm?: boolean\n) => Exports | EsmNamespaceObject;\ntype ExternalImport = (id: ModuleId) => Promise<Exports | EsmNamespaceObject>;\n\ninterface TurbopackNodeBuildContext extends TurbopackBaseContext<Module> {\n  R: ResolvePathFromModule;\n  x: ExternalRequire;\n  y: ExternalImport;\n}\n\ntype ModuleFactory = (\n  this: Module[\"exports\"],\n  context: TurbopackNodeBuildContext\n) => undefined;\n\nconst url = require(\"url\") as typeof import('url');\nconst fs = require(\"fs/promises\") as typeof import('fs/promises');\n\nconst moduleFactories: ModuleFactories = Object.create(null);\nconst moduleCache: ModuleCache<ModuleWithDirection> = Object.create(null);\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction createResolvePathFromModule(\n  resolver: (moduleId: string) => Exports\n): (moduleId: string) => string {\n  return function resolvePathFromModule(moduleId: string): string {\n    const exported = resolver(moduleId);\n    const exportedPath = exported?.default ?? exported;\n    if (typeof exportedPath !== \"string\") {\n      return exported as any;\n    }\n\n    const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length);\n    const resolved = path.resolve(\n      RUNTIME_ROOT,\n      strippedAssetPrefix\n    );\n\n    return url.pathToFileURL(resolved).href;\n  };\n}\n\nfunction loadChunk(chunkData: ChunkData, source?: SourceInfo): void {\n  if (typeof chunkData === \"string\") {\n    return loadChunkPath(chunkData, source);\n  } else {\n    return loadChunkPath(chunkData.path, source);\n  }\n}\n\nfunction loadChunkPath(chunkPath: ChunkPath, source?: SourceInfo): void {\n  if (!isJs(chunkPath)) {\n    // We only support loading JS chunks in Node.js.\n    // This branch can be hit when trying to load a CSS chunk.\n    return;\n  }\n\n  try {\n    const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n    const chunkModules: ModuleFactories = require(resolved);\n\n    for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) {\n      if (!moduleFactories[moduleId]) {\n        moduleFactories[moduleId] = moduleFactory;\n      }\n    }\n  } catch (e) {\n    let errorMessage = `Failed to load chunk ${chunkPath}`;\n\n    if (source) {\n      errorMessage += ` from ${stringifySourceInfo(source)}`;\n    }\n\n    throw new Error(errorMessage, {\n      cause: e,\n    });\n  }\n}\n\nasync function loadChunkAsync(\n  source: SourceInfo,\n  chunkData: ChunkData\n): Promise<any> {\n  const chunkPath = typeof chunkData === \"string\" ? chunkData : chunkData.path;\n  if (!isJs(chunkPath)) {\n    // We only support loading JS chunks in Node.js.\n    // This branch can be hit when trying to load a CSS chunk.\n    return;\n  }\n\n  const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n\n  try {\n    const contents = await fs.readFile(resolved, \"utf-8\");\n\n    const localRequire = (id: string) => {\n      let resolvedId = require.resolve(id, {paths: [path.dirname(resolved)]});\n      return require(resolvedId);\n    }\n    const module = {\n      exports: {},\n    };\n    // TODO: Use vm.runInThisContext once our minimal supported Node.js version includes https://github.com/nodejs/node/pull/52153\n    // eslint-disable-next-line no-eval -- Can't use vm.runInThisContext due to https://github.com/nodejs/node/issues/52102\n    (0, eval)(\n      \"(function(module, exports, require, __dirname, __filename) {\" +\n        contents +\n        \"\\n})\" +\n        \"\\n//# sourceURL=\" + url.pathToFileURL(resolved),\n    )(module, module.exports, localRequire, path.dirname(resolved), resolved);\n\n    const chunkModules: ModuleFactories = module.exports;\n    for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) {\n      if (!moduleFactories[moduleId]) {\n        moduleFactories[moduleId] = moduleFactory;\n      }\n    }\n  } catch (e) {\n    let errorMessage = `Failed to load chunk ${chunkPath}`;\n\n    if (source) {\n      errorMessage += ` from ${stringifySourceInfo(source)}`;\n    }\n\n    throw new Error(errorMessage, {\n      cause: e,\n    });\n  }\n}\n\nasync function loadChunkAsyncByUrl(source: SourceInfo, chunkUrl: string) {\n  const path = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT)) as ChunkPath;\n  return loadChunkAsync(source, path);\n}\n\nfunction loadWebAssembly(chunkPath: ChunkPath, imports: WebAssembly.Imports) {\n  const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n\n  return instantiateWebAssemblyFromPath(resolved, imports);\n}\n\nfunction loadWebAssemblyModule(chunkPath: ChunkPath) {\n  const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n\n  return compileWebAssemblyFromPath(resolved);\n}\n\nfunction getWorkerBlobURL(_chunks: ChunkPath[]): string {\n  throw new Error(\"Worker blobs are not implemented yet for Node.js\");\n}\n\nfunction instantiateModule(id: ModuleId, source: SourceInfo): ModuleWithDirection {\n  const moduleFactory = moduleFactories[id];\n  if (typeof moduleFactory !== \"function\") {\n    // This can happen if modules incorrectly handle HMR disposes/updates,\n    // e.g. when they keep a `setTimeout` around which still executes old code\n    // and contains e.g. a `require(\"something\")` call.\n    let instantiationReason;\n    switch (source.type) {\n      case SourceType.Runtime:\n        instantiationReason = `as a runtime entry of chunk ${source.chunkPath}`;\n        break;\n      case SourceType.Parent:\n        instantiationReason = `because it was required from module ${source.parentId}`;\n        break;\n      default:\n        invariant(source, (source) => `Unknown source type: ${source?.type}`);\n    }\n    throw new Error(\n      `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available. It might have been deleted in an HMR update.`\n    );\n  }\n\n  let parents: ModuleId[];\n  switch (source.type) {\n    case SourceType.Runtime:\n      parents = [];\n      break;\n    case SourceType.Parent:\n      // No need to add this module as a child of the parent module here, this\n      // has already been taken care of in `getOrInstantiateModuleFromParent`.\n      parents = [source.parentId];\n      break;\n    default:\n      invariant(source, (source) => `Unknown source type: ${source?.type}`);\n  }\n\n  const module: ModuleWithDirection = {\n    exports: {},\n    error: undefined,\n    loaded: false,\n    id,\n    parents,\n    children: [],\n    namespaceObject: undefined,\n  };\n  moduleCache[id] = module;\n\n  // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n  try {\n    const r = commonJsRequire.bind(null, module);\n    moduleFactory.call(module.exports, {\n      a: asyncModule.bind(null, module),\n      e: module.exports,\n      r,\n      t: runtimeRequire,\n      x: externalRequire,\n      y: externalImport,\n      f: moduleContext,\n      i: esmImport.bind(null, module),\n      s: esmExport.bind(null, module, module.exports),\n      j: dynamicExport.bind(null, module, module.exports),\n      v: exportValue.bind(null, module),\n      n: exportNamespace.bind(null, module),\n      m: module,\n      c: moduleCache,\n      M: moduleFactories,\n      l: loadChunkAsync.bind(null, { type: SourceType.Parent, parentId: id }),\n      L: loadChunkAsyncByUrl.bind(null, { type: SourceType.Parent, parentId: id }),\n      w: loadWebAssembly,\n      u: loadWebAssemblyModule,\n      g: globalThis,\n      P: resolveAbsolutePath,\n      U: relativeURL,\n      R: createResolvePathFromModule(r),\n      b: getWorkerBlobURL,\n      z: requireStub,\n      __dirname: typeof module.id === \"string\" ? module.id.replace(/(^|\\/)\\/+$/, \"\") : module.id\n    });\n  } catch (error) {\n    module.error = error as any;\n    throw error;\n  }\n\n  module.loaded = true;\n  if (module.namespaceObject && module.exports !== module.namespaceObject) {\n    // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n    interopEsm(module.exports, module.namespaceObject);\n  }\n\n  return module;\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore\nfunction getOrInstantiateModuleFromParent(\n  id: ModuleId,\n  sourceModule: ModuleWithDirection\n): ModuleWithDirection {\n  const module = moduleCache[id];\n\n  if (sourceModule.children.indexOf(id) === -1) {\n    sourceModule.children.push(id);\n  }\n\n  if (module) {\n    if (module.parents.indexOf(sourceModule.id) === -1) {\n      module.parents.push(sourceModule.id);\n    }\n\n    return module;\n  }\n\n  return instantiateModule(id, {\n    type: SourceType.Parent,\n    parentId: sourceModule.id,\n  });\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n  moduleId: ModuleId,\n  chunkPath: ChunkPath\n): Module {\n  return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath });\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\n// @ts-ignore TypeScript doesn't separate this module space from the browser runtime\nfunction getOrInstantiateRuntimeModule(\n  moduleId: ModuleId,\n  chunkPath: ChunkPath\n): Module {\n  const module = moduleCache[moduleId];\n  if (module) {\n    if (module.error) {\n      throw module.error;\n    }\n    return module;\n  }\n\n  return instantiateRuntimeModule(moduleId, chunkPath);\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/;\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n  return regexJsUrl.test(chunkUrlOrPath);\n}\n\nmodule.exports = {\n  getOrInstantiateRuntimeModule,\n  loadChunk,\n};\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AACnD,+DAA+D;AAC/D,+DAA+D;AAC/D,0DAA0D;AAE1D,IAAA,AAAK,oCAAA;IACH;;;GAGC;IAED;;GAEC;WARE;EAAA;AAsBL,SAAS,oBAAoB,MAAkB;IAC7C,OAAQ,OAAO,IAAI;QACjB;YACE,OAAO,CAAC,kBAAkB,EAAE,OAAO,SAAS,EAAE;QAChD;YACE,OAAO,CAAC,cAAc,EAAE,OAAO,QAAQ,EAAE;QAC3C;YACE,UAAU,QAAQ,CAAC,SAAW,CAAC,qBAAq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;CAEC,GACD,SAAS,yBACP,QAAkB,EAClB,SAAoB;IAEpB,OAAO,kBAAkB,UAAU;QAAE,IAAI;QAAsB;IAAU;AAC3E;AAEA;;CAEC,GACD,oFAAoF;AACpF,SAAS,8BACP,QAAkB,EAClB,SAAoB;IAEpB,MAAM,UAAS,WAAW,CAAC,SAAS;IACpC,IAAI,SAAQ;QACV,IAAI,QAAO,KAAK,EAAE;YAChB,MAAM,QAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,OAAO,yBAAyB,UAAU;AAC5C;AAEA,MAAM,aAAa;AACnB;;CAEC,GACD,SAAS,KAAK,cAAoC;IAChD,OAAO,WAAW,IAAI,CAAC;AACzB;AAEA,OAAO,OAAO,GAAG;IACf;IACA;AACF","ignoreList":[0]}}]
+    {"offset": {"line": 417, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/nodejs/runtime.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// <reference path=\"../shared/runtime-utils.ts\" />\n/// <reference path=\"../shared-node/base-externals-utils.ts\" />\n/// <reference path=\"../shared-node/node-externals-utils.ts\" />\n/// <reference path=\"../shared-node/node-wasm-utils.ts\" />\n\nenum SourceType {\n  /**\n   * The module was instantiated because it was included in an evaluated chunk's\n   * runtime.\n   */\n  Runtime = 0,\n  /**\n   * The module was instantiated because a parent module imported it.\n   */\n  Parent = 1,\n}\n\ntype SourceInfo =\n  | {\n      type: SourceType.Runtime;\n      chunkPath: ChunkPath;\n    }\n  | {\n      type: SourceType.Parent;\n      parentId: ModuleId;\n    };\n\nprocess.env.TURBOPACK = '1';\n\nfunction stringifySourceInfo(source: SourceInfo): string {\n  switch (source.type) {\n    case SourceType.Runtime:\n      return `runtime for chunk ${source.chunkPath}`;\n    case SourceType.Parent:\n      return `parent module ${source.parentId}`;\n    default:\n      invariant(source, (source) => `Unknown source type: ${source?.type}`);\n  }\n}\n\ntype ExternalRequire = (\n  id: ModuleId,\n  thunk: () => any,\n  esm?: boolean\n) => Exports | EsmNamespaceObject;\ntype ExternalImport = (id: ModuleId) => Promise<Exports | EsmNamespaceObject>;\n\ninterface TurbopackNodeBuildContext extends TurbopackBaseContext<Module> {\n  R: ResolvePathFromModule;\n  x: ExternalRequire;\n  y: ExternalImport;\n}\n\ntype ModuleFactory = (\n  this: Module[\"exports\"],\n  context: TurbopackNodeBuildContext\n) => undefined;\n\nconst url = require(\"url\") as typeof import('url');\nconst fs = require(\"fs/promises\") as typeof import('fs/promises');\n\nconst moduleFactories: ModuleFactories = Object.create(null);\nconst moduleCache: ModuleCache<ModuleWithDirection> = Object.create(null);\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction createResolvePathFromModule(\n  resolver: (moduleId: string) => Exports\n): (moduleId: string) => string {\n  return function resolvePathFromModule(moduleId: string): string {\n    const exported = resolver(moduleId);\n    const exportedPath = exported?.default ?? exported;\n    if (typeof exportedPath !== \"string\") {\n      return exported as any;\n    }\n\n    const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length);\n    const resolved = path.resolve(\n      RUNTIME_ROOT,\n      strippedAssetPrefix\n    );\n\n    return url.pathToFileURL(resolved).href;\n  };\n}\n\nfunction loadChunk(chunkData: ChunkData, source?: SourceInfo): void {\n  if (typeof chunkData === \"string\") {\n    return loadChunkPath(chunkData, source);\n  } else {\n    return loadChunkPath(chunkData.path, source);\n  }\n}\n\nfunction loadChunkPath(chunkPath: ChunkPath, source?: SourceInfo): void {\n  if (!isJs(chunkPath)) {\n    // We only support loading JS chunks in Node.js.\n    // This branch can be hit when trying to load a CSS chunk.\n    return;\n  }\n\n  try {\n    const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n    const chunkModules: ModuleFactories = require(resolved);\n\n    for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) {\n      if (!moduleFactories[moduleId]) {\n        moduleFactories[moduleId] = moduleFactory;\n      }\n    }\n  } catch (e) {\n    let errorMessage = `Failed to load chunk ${chunkPath}`;\n\n    if (source) {\n      errorMessage += ` from ${stringifySourceInfo(source)}`;\n    }\n\n    throw new Error(errorMessage, {\n      cause: e,\n    });\n  }\n}\n\nasync function loadChunkAsync(\n  source: SourceInfo,\n  chunkData: ChunkData\n): Promise<any> {\n  const chunkPath = typeof chunkData === \"string\" ? chunkData : chunkData.path;\n  if (!isJs(chunkPath)) {\n    // We only support loading JS chunks in Node.js.\n    // This branch can be hit when trying to load a CSS chunk.\n    return;\n  }\n\n  const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n\n  try {\n    const contents = await fs.readFile(resolved, \"utf-8\");\n\n    const localRequire = (id: string) => {\n      let resolvedId = require.resolve(id, {paths: [path.dirname(resolved)]});\n      return require(resolvedId);\n    }\n    const module = {\n      exports: {},\n    };\n    // TODO: Use vm.runInThisContext once our minimal supported Node.js version includes https://github.com/nodejs/node/pull/52153\n    // eslint-disable-next-line no-eval -- Can't use vm.runInThisContext due to https://github.com/nodejs/node/issues/52102\n    (0, eval)(\n      \"(function(module, exports, require, __dirname, __filename) {\" +\n        contents +\n        \"\\n})\" +\n        \"\\n//# sourceURL=\" + url.pathToFileURL(resolved),\n    )(module, module.exports, localRequire, path.dirname(resolved), resolved);\n\n    const chunkModules: ModuleFactories = module.exports;\n    for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) {\n      if (!moduleFactories[moduleId]) {\n        moduleFactories[moduleId] = moduleFactory;\n      }\n    }\n  } catch (e) {\n    let errorMessage = `Failed to load chunk ${chunkPath}`;\n\n    if (source) {\n      errorMessage += ` from ${stringifySourceInfo(source)}`;\n    }\n\n    throw new Error(errorMessage, {\n      cause: e,\n    });\n  }\n}\n\nasync function loadChunkAsyncByUrl(source: SourceInfo, chunkUrl: string) {\n  const path = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT)) as ChunkPath;\n  return loadChunkAsync(source, path);\n}\n\nfunction loadWebAssembly(chunkPath: ChunkPath, imports: WebAssembly.Imports) {\n  const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n\n  return instantiateWebAssemblyFromPath(resolved, imports);\n}\n\nfunction loadWebAssemblyModule(chunkPath: ChunkPath) {\n  const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n\n  return compileWebAssemblyFromPath(resolved);\n}\n\nfunction getWorkerBlobURL(_chunks: ChunkPath[]): string {\n  throw new Error(\"Worker blobs are not implemented yet for Node.js\");\n}\n\nfunction instantiateModule(id: ModuleId, source: SourceInfo): ModuleWithDirection {\n  const moduleFactory = moduleFactories[id];\n  if (typeof moduleFactory !== \"function\") {\n    // This can happen if modules incorrectly handle HMR disposes/updates,\n    // e.g. when they keep a `setTimeout` around which still executes old code\n    // and contains e.g. a `require(\"something\")` call.\n    let instantiationReason;\n    switch (source.type) {\n      case SourceType.Runtime:\n        instantiationReason = `as a runtime entry of chunk ${source.chunkPath}`;\n        break;\n      case SourceType.Parent:\n        instantiationReason = `because it was required from module ${source.parentId}`;\n        break;\n      default:\n        invariant(source, (source) => `Unknown source type: ${source?.type}`);\n    }\n    throw new Error(\n      `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available. It might have been deleted in an HMR update.`\n    );\n  }\n\n  let parents: ModuleId[];\n  switch (source.type) {\n    case SourceType.Runtime:\n      parents = [];\n      break;\n    case SourceType.Parent:\n      // No need to add this module as a child of the parent module here, this\n      // has already been taken care of in `getOrInstantiateModuleFromParent`.\n      parents = [source.parentId];\n      break;\n    default:\n      invariant(source, (source) => `Unknown source type: ${source?.type}`);\n  }\n\n  const module: ModuleWithDirection = {\n    exports: {},\n    error: undefined,\n    loaded: false,\n    id,\n    parents,\n    children: [],\n    namespaceObject: undefined,\n  };\n  moduleCache[id] = module;\n\n  // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n  try {\n    const r = commonJsRequire.bind(null, module);\n    moduleFactory.call(module.exports, {\n      a: asyncModule.bind(null, module),\n      e: module.exports,\n      r,\n      t: runtimeRequire,\n      x: externalRequire,\n      y: externalImport,\n      f: moduleContext,\n      i: esmImport.bind(null, module),\n      s: esmExport.bind(null, module, module.exports),\n      j: dynamicExport.bind(null, module, module.exports),\n      v: exportValue.bind(null, module),\n      n: exportNamespace.bind(null, module),\n      m: module,\n      c: moduleCache,\n      M: moduleFactories,\n      l: loadChunkAsync.bind(null, { type: SourceType.Parent, parentId: id }),\n      L: loadChunkAsyncByUrl.bind(null, { type: SourceType.Parent, parentId: id }),\n      w: loadWebAssembly,\n      u: loadWebAssemblyModule,\n      g: globalThis,\n      P: resolveAbsolutePath,\n      U: relativeURL,\n      R: createResolvePathFromModule(r),\n      b: getWorkerBlobURL,\n      z: requireStub,\n      __dirname: typeof module.id === \"string\" ? module.id.replace(/(^|\\/)\\/+$/, \"\") : module.id\n    });\n  } catch (error) {\n    module.error = error as any;\n    throw error;\n  }\n\n  module.loaded = true;\n  if (module.namespaceObject && module.exports !== module.namespaceObject) {\n    // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n    interopEsm(module.exports, module.namespaceObject);\n  }\n\n  return module;\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore\nfunction getOrInstantiateModuleFromParent(\n  id: ModuleId,\n  sourceModule: ModuleWithDirection\n): ModuleWithDirection {\n  const module = moduleCache[id];\n\n  if (sourceModule.children.indexOf(id) === -1) {\n    sourceModule.children.push(id);\n  }\n\n  if (module) {\n    if (module.parents.indexOf(sourceModule.id) === -1) {\n      module.parents.push(sourceModule.id);\n    }\n\n    return module;\n  }\n\n  return instantiateModule(id, {\n    type: SourceType.Parent,\n    parentId: sourceModule.id,\n  });\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n  moduleId: ModuleId,\n  chunkPath: ChunkPath\n): Module {\n  return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath });\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\n// @ts-ignore TypeScript doesn't separate this module space from the browser runtime\nfunction getOrInstantiateRuntimeModule(\n  moduleId: ModuleId,\n  chunkPath: ChunkPath\n): Module {\n  const module = moduleCache[moduleId];\n  if (module) {\n    if (module.error) {\n      throw module.error;\n    }\n    return module;\n  }\n\n  return instantiateRuntimeModule(moduleId, chunkPath);\n}\n\nconst regexJsUrl = /\\.js(?:\\?[^#]*)?(?:#.*)?$/;\n/**\n * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.\n */\nfunction isJs(chunkUrlOrPath: ChunkUrl | ChunkPath): boolean {\n  return regexJsUrl.test(chunkUrlOrPath);\n}\n\nmodule.exports = {\n  getOrInstantiateRuntimeModule,\n  loadChunk,\n};\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AACnD,+DAA+D;AAC/D,+DAA+D;AAC/D,0DAA0D;AAE1D,IAAA,AAAK,oCAAA;IACH;;;GAGC;IAED;;GAEC;WARE;EAAA;AAsBL,QAAQ,GAAG,CAAC,SAAS,GAAG;AAExB,SAAS,oBAAoB,MAAkB;IAC7C,OAAQ,OAAO,IAAI;QACjB;YACE,OAAO,CAAC,kBAAkB,EAAE,OAAO,SAAS,EAAE;QAChD;YACE,OAAO,CAAC,cAAc,EAAE,OAAO,QAAQ,EAAE;QAC3C;YACE,UAAU,QAAQ,CAAC,SAAW,CAAC,qBAAqB,EAAE,QAAQ,MAAM;IACxE;AACF;AAoBA,MAAM,MAAM,QAAQ;AACpB,MAAM,KAAK,QAAQ;AAEnB,MAAM,kBAAmC,OAAO,MAAM,CAAC;AACvD,MAAM,cAAgD,OAAO,MAAM,CAAC;AAEpE;;CAEC,GACD,SAAS,4BACP,QAAuC;IAEvC,OAAO,SAAS,sBAAsB,QAAgB;QACpD,MAAM,WAAW,SAAS;QAC1B,MAAM,eAAe,UAAU,WAAW;QAC1C,IAAI,OAAO,iBAAiB,UAAU;YACpC,OAAO;QACT;QAEA,MAAM,sBAAsB,aAAa,KAAK,CAAC,aAAa,MAAM;QAClE,MAAM,WAAW,KAAK,OAAO,CAC3B,cACA;QAGF,OAAO,IAAI,aAAa,CAAC,UAAU,IAA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