weakError({ module, chunkGraph, request, idExpr, type }) {
		const moduleId = chunkGraph.getModuleId(module);
		const errorMessage =
			moduleId === null
				? JSON.stringify("Module is not available (weak dependency)")
				: idExpr
					? `"Module '" + ${idExpr} + "' is not available (weak dependency)"`
					: JSON.stringify(
							`Module '${moduleId}' is not available (weak dependency)`
						);
		const comment = request ? `${Template.toNormalComment(request)} ` : "";
		const errorStatements = `var e = new Error(${errorMessage}); ${
			comment
		}e.code = 'MODULE_NOT_FOUND'; throw e;`;
		switch (type) {
			case "statements":
				return errorStatements;
			case "promise":
				return `Promise.resolve().then(${this.basicFunction(
					"",
					errorStatements
				)})`;
			case "expression":
				return this.iife("", errorStatements);
		}
	}
@param {object} options options object
@param {ChunkGraph} options.chunkGraph the chunk graph
@param {Module} options.module the module
@param {string=} options.request the request that should be printed as comment
@param {string=} options.idExpr expression to use as id expression
@param {"expression" | "promise" | "statements"} options.type which kind of code should be returned
@returns {string} the code