Skip to content

Fix Webpack startup for Node 23+ by explicitly registering ts-node #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025

Conversation

RillJ
Copy link
Contributor

@RillJ RillJ commented May 6, 2025

Recent versions of Node (v23+) attempt to interpret TypeScript files directly, which breaks when loading TS-based Webpack config files. This repo uses TypeScript config files (e.g. webpack.dev.ts, webpack.prod.ts), and previously relied on older Node behavior or indirect loading.

This PR adds -r ts-node/register to the relevant npm scripts:

  • start:web
  • build:default
  • build:windows

This makes it compatible with newer Node versions without requiring contributors to downgrade. Existing behaviour on older versions of Node remains unchanged.

Fix for #153.

@CLAassistant
Copy link

CLAassistant commented May 6, 2025

CLA assistant check
All committers have signed the CLA.

@pimterry pimterry merged commit bb14c0b into httptoolkit:main May 6, 2025
7 checks passed
@pimterry
Copy link
Member

pimterry commented May 6, 2025

This is great, thanks @RillJ! Seems this was powered by some automatic webpack behaviour, which presumably conflicts with modern Node's approach. Doing this explicitly is much better 👍

In case you're not aware: all contributors to all the HTTP Toolkit repos get free HTTP Toolkit Pro. If that's something you're interested just let me know your email (here or via tim @ httptoolkit.com) and I'll set you up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants