pkgs icon indicating copy to clipboard operation
pkgs copied to clipboard

__webpack_require__(...).context is not a function

Open thatsmydoing opened this issue 1 year ago • 1 comments

From https://github.com/swc-project/swc-loader/issues/64#issue-1335268930 by @callmeteus

I'm trying to port from babel-loader and ts-loader to swc-loader, but everytime require.context is called, it returns undefined.

When printing the require variable, it returns the following module:

function webpackEmptyContext(req) {
	var e = new Error("Cannot find module '" + req + "'");
	e.code = 'MODULE_NOT_FOUND';
	throw e;
}
webpackEmptyContext.keys = () => ([]);
webpackEmptyContext.resolve = webpackEmptyContext;
webpackEmptyContext.id = 5102;
module.exports = webpackEmptyContext;

thatsmydoing avatar Oct 27 '23 09:10 thatsmydoing