stdlib-js / stdlib-js/stdlib

[BUG]: quantile function of Beta distribution fails in production build with Next.js

Ouverte
#3,011 8 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Bug Needs Discussion Statistics
Langage dominant
JavaScript
Étoiles
6k
Forks
1.3k
Merge moyen
1 j 3 h
PR mergées (30 j)
611

Description

### Description

I have an application written in Next.js and some code that uses `beta` distribution from `'@stdlib/stats-base-dists/dist'`. I noticed that the `quantile` function is completely broken while building the application in production mode (`next build && next start`). For example the output in Chrome console:
```js
> dist = new window.beta_test.Beta(5, 5) // I did an ugly hack window.beta_test = beta in the code
w {}
> dist.quantile(0.1)
0.9999999996744877
> dist.quantile(0.5)
4.6663115970492885e-302
```

The quantile function works as expected if I run the application in the development mode (`next dev`)
```js
> dist = new window.beta_test.Beta(5, 5)
t {}
> dist.quantile(0.1)
0.30096876359321467
> dist.quantile(0.5)
0.5
```
I'm not sure if this is the case with other distributions

### Related Issues

Related issues # , # , and # .

### Questions

No.

### Demo

_No response_

### Reproduction

- a
- b
- c

### Expected Results

_No response_

### Actual Results

_No response_

### Version

0.2.2

### Environments

Chrome

### Browser Version

129.0.6668.91

### Node.js / npm Version

_No response_

### Platform

MacOS

### Checklist

- [x] Read and understood the [Code of Conduct](https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md).
- [x] Searched for existing issues and pull requests.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start with the @stdlib/stats-base-dists/dist Beta entry point and reproduce the reported quantile calls under next dev versus next build && next start. Trace the production bundle behavior around Beta.quantile and compare it with development behavior. Done means quantile returns the expected values in a production Next.js build, with regression coverage if the relevant test location is identified.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
javascript, next.js
Domaine
build-system
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.