Skip to content
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

Update node versions #617

Open
josephjclark opened this issue Mar 1, 2024 · 4 comments
Open

Update node versions #617

josephjclark opened this issue Mar 1, 2024 · 4 comments

Comments

@josephjclark
Copy link
Collaborator

  • Ensure everything works in node 18.19
  • Ensure everything works in 20.latest
  • Ensure everything works in 21.x

Ideally we should just work across all vaguely modern node versions.

18.19 did something I think to break the loader vm arg, which causes all sorts of problems.

@Akshanshkaushal
Copy link

hi @josephjclark @christad92 To better understand the codebase, I want to solve this issue. Could you please assign me this?

@josephjclark
Copy link
Collaborator Author

Sorry @Akshanshkaushal this is one I want to take on myself

@josephjclark
Copy link
Collaborator Author

josephjclark commented Jul 18, 2024

So the problem we have is that node 20 changes the way loaders work, which breaks our ava config. This will affect adaptors as well - see OpenFn/adaptors#187

I think the issue technically is that a) loaders now run in worker threads (something to do with not corrupting the global environment), and b) If you want a worker thread itself to us a loader, basically you can't feed the option through. I think this is the active bug on nodejs: nodejs/node#47747

The first problem is that the ts node loader has changed and doesn't work with ava. It works if I use a thing called tsimp, but it builds all the test files to disk. Not essential I suppose but it annoys me. Also the docs say it does everything virtually, so that's kinda confusing.

I suppose one solution here is to just wait this out and still on node 18 for a while. It doesn't affect the runtime, only the build-time.

The second problem is some changes about importing folders, which we can't do any more. I suppose we'll just have re-write the affected code, although that could be a big job

@josephjclark
Copy link
Collaborator Author

Running ava with workerThreads off (forcing it to use child processes) works fine, at the cost of using more system resources (and so being slower in CI).

What I'm confused at with this is that I don't get import errors for importing folders and stuff, which I do get when using other loaders. Is that just a config thing?

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

No branches or pull requests

2 participants