Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

* Fixed `--override` to support `package-lock.json` with `lockfileVersion` 2 and 3.

### pack

* Fixed `enact pack` to work with TypeScript 7 by skipping in-build type checking (`fork-ts-checker`), which requires the JavaScript API that TypeScript 7 no longer provides.
* Fixed `enact pack` to report errors thrown while preparing the build and exit with a non-zero status, rather than logging them as an uncaught exception and exiting successfully without producing any output.

### serve

* Fixed `enact serve` to report errors thrown while preparing the build and exit with a non-zero status.

## 7.3.3 (July 7, 2026)

### transpile
Expand Down
13 changes: 9 additions & 4 deletions commands/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,16 @@ function cli (args) {
chalk = _chalk;
import('strip-ansi').then(({default: _stripAnsi}) => {
stripAnsi = _stripAnsi;
api(opts).catch(err => {
printErrorDetails(err, () => {
process.exit(1);
// Run api() inside the promise chain so that errors thrown synchronously while preparing the
// build (e.g. creating the webpack config) are reported and fail the process, rather than
// becoming an uncaught exception that bin/enact.js logs and then exits successfully.
Promise.resolve()
.then(() => api(opts))
.catch(err => {
printErrorDetails(err, () => {
process.exit(1);
});
});
});
});
});
}
Expand Down
14 changes: 9 additions & 5 deletions commands/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,15 @@ function cli (args) {

import('chalk').then(({default: _chalk}) => {
chalk = _chalk;
api(opts).catch(err => {
// console.error(chalk.red('ERROR: ') + (err.message || err));
console.log(err);
process.exit(1);
});
// Run api() inside the promise chain so errors thrown synchronously are reported and fail the
// process instead of becoming an uncaught exception that bin/enact.js logs and swallows.
Promise.resolve()
.then(() => api(opts))
.catch(err => {
// console.error(chalk.red('ERROR: ') + (err.message || err));
console.log(err);
process.exit(1);
});
});
}

Expand Down
21 changes: 20 additions & 1 deletion config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@ const {
} = require('@enact/dev-utils');
const createEnvironmentHash = require('./createEnvironmentHash');

// TypeScript 7 and later no longer ship the classic JavaScript API (and have no `main` entry for
// `resolve` to find) that fork-ts-checker relies on, so in-build type checking is only available
// with TypeScript < 7. Source files are still transpiled by Babel regardless of the version; use
// `tsc` to type check with TypeScript 7+.
function hasTypeScriptJsApi () {
let version;
try {
version = require(path.resolve('node_modules/typescript/package.json')).version;
} catch (e) {
// TypeScript is not installed; let the type checker setup report that.
return true;
}
if (parseInt(version) >= 7) {
console.log(`TypeScript ${version} detected: skipping in-build type checking (run tsc separately).`);
return false;
}
return true;
}

// This is the production and development configuration.
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
module.exports = function (
Expand Down Expand Up @@ -624,7 +643,7 @@ module.exports = function (
// and parses any to copy over any webOS meta assets at build time.
new WebOSMetaPlugin({htmlPlugin: HtmlWebpackPlugin}),
// TypeScript type checking
useTypeScript &&
useTypeScript && hasTypeScriptJsApi() &&
new ForkTsCheckerWebpackPlugin({
async: !isEnvProduction,
typescript: {
Expand Down
Loading