You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var webpack = require("webpack");
var webpackConfig = require("./webpack.config.js");
var compiler = webpack(webpackConfig, (err, stats) => {
if (err) {
console.error(err);
};
});
Running node ./test.js works.
But given the following gulp task:
var webpack = require("webpack");
var webpackConfig = require("./webpack.config.js");
var starting = true;
gulp.task("ugh", function(cb) {
var compiler = webpack(webpackConfig, (err, stats) => {
if (err) {
console.error(err);
};
if (starting) {
starting = false;
cb();
}
});
});
Running gulp ugh yields these errors:
Unhandled Rejection at: Promise Promise {
<rejected> TypeError: Cannot read property 'default' of undefined
at /Users/mitchellmorris/Sites/projects/sandbox/node_modules/loader-runner/lib/loadLoader.js:4:66
} reason: TypeError: Cannot read property 'default' of undefined
at /Users/mitchellmorris/Sites/projects/sandbox/node_modules/loader-runner/lib/loadLoader.js:4:66
Unhandled Rejection at: Promise Promise {
<rejected> TypeError: Cannot read property 'default' of undefined
at /Users/mitchellmorris/Sites/projects/sandbox/node_modules/loader-runner/lib/loadLoader.js:4:66
} reason: TypeError: Cannot read property 'default' of undefined
at /Users/mitchellmorris/Sites/projects/sandbox/node_modules/loader-runner/lib/loadLoader.js:4:66
From what I can tell given the following block that System(in node_modules/loader-runner/lib/loadLoader.js) only defined when leveraging gulp and emitting an undefined result(i.e. module).
module.exports = function loadLoader(loader, callback) {
if(typeof System === "object" && typeof System.import === "function") {
console.log("This only happens using gulp.");
System.import(loader.path).catch(callback).then(function(module) {
console.log("further more module is undefined!");
loader.normal = typeof module === "function" ? module : module.default;
// ...
});
} else {
console.log("This only happens using node ./test.js or webpack and is successfull.");
// ...
}
}
Can anyone help please?
The text was updated successfully, but these errors were encountered:
mitchellmorris
changed the title
Issue with when running webpack 3.4.1 from custom gulp task
Issue with System module undefined error when running webpack 3.4.1 from custom gulp task
Aug 4, 2017
Given the following config(in file webpack.config.js) using either ts-loader or awesome-typescript-loader:
Running
webpack
works.Given the following file, test.js:
Running
node ./test.js
works.But given the following gulp task:
Running
gulp ugh
yields these errors:From what I can tell given the following block that System(in node_modules/loader-runner/lib/loadLoader.js) only defined when leveraging gulp and emitting an undefined result(i.e. module).
Can anyone help please?
The text was updated successfully, but these errors were encountered: