stdlib-js / stdlib-js/stdlib

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

Abierto
#3,011 8 comentarios 0 reacciones 0 asignados Ver en GitHub
Bug Needs Discussion Statistics
Lenguaje dominante
JavaScript
Estrellas
6k
Forks
1.3k
Merge medio
1 d 3 h
PR fusionados (30 d)
611

Descripción

### 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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, next.js
Área
build-system
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.