[BUG]: quantile function of Beta distribution fails in production build with Next.js
- Lingua principale
- JavaScript
- Stelle
- 6k
- Fork
- 1.3k
- Merge medio
- 1g 3h
- PR unite (30g)
- 611
Descrizione
### 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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, next.js
- Ambito
- build-system
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100