Enabling different build targets for jsPsych plugins

Open
#3,545 4 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@bjoluc is already working on this.

Since May 16, 2025.

Assessment

This issue has not been assessed yet.

Description

area: infrastructure maintenance status: needs decision

Wanted to start a discussion and track the issue around build targets for jsPsych.

We're currently developing a plugin https://github.com/teonbrooks/plugin-voice-response that enables speech transcription but we're currently running into a problem where we get the following error:

[!] (plugin esbuild) Error: Transform failed with 15 errors:
<stdin>:1411:17733: ERROR: Big integer literals are not available in the configured target environment ("es2015")
<stdin>:1411:17760: ERROR: Big integer literals are not available in the configured target environment ("es2015")
<stdin>:1418:24595: ERROR: Big integer literals are not available in the configured target environment ("es2015")
<stdin>:1418:24611: ERROR: Big integer literals are not available in the configured target environment ("es2015")
<stdin>:11941:46: ERROR: Big integer literals are not available in the configured target environment ("es2015")
...

We think the source of this error is caused by our use of transformers.js/onnx-runtime, which uses Big integer literals.

I first fixed this with a hack by going into the node_modules of my plugin and editing the jspsych/config library directly by changing the build target from es2015 to es2020 in the Minified production IIFE build section. This made the error go away.

We decided to patch this the proper why by modifying the rollup.config.mjs within our plugin and reverting back the hack, but the error above seems to have returned and I don't know why.
cf. https://github.com/teonbrooks/plugin-voice-response/blob/dev-transformers/rollup.config.mjs

A few questions:

  1. Does this config file seem alright? I was looking for a way to only modify the part of the config file I touched. Feedback is greatly appreciated :)

  2. Is it possible to have different build targets for jspsych core and jspsych plugins?

  3. I see that all the other build steps use esnext instead of a specified year. Changing it to esnext in jsPsych directly fixes the error as well. Could that be used without breaking other users' setup? If so, that would be the easiest solution.

cc: @becky-gilbert @jodeleeuw @jkhartshorne

Dominant language
TypeScript
Stars
1.2k
Forks
745
Avg merge
5h 50m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jspsych/jsPsych

All issues in jspsych/jsPsych

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.