FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, webpack
- Área
- build-system, web-dev
Línea de trabajo
Comienza con la importación workerize-loader!../../workers/headerWorker, el módulo ../../workers/headerWorker correspondiente y la salida de compilación de webpack proporcionada; reproduce el fallo del heap con el uso de TypeScript/React mostrado. Se considera terminado cuando se haya determinado si este uso del loader es compatible y se haya documentado una solución reproducible o una guía clara.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hi, I'm trying to use your package but I'm not able to make it work. If I remove my worker from the application compiles fine, once I uncomment the code I get the error message:
69% building 3094/3117 modules 23 active C:\Desarrollo\uiserpreco2\uiserpreco\node_modules\ts-loader\index.js!C:\Desarrollo\uiserpreco2\uiserpreco\src\app\components\Maintenance\Clients\ClientWizardRedirect.tsx
<--- Last few GCs --->
[7332:000001A3BF8073C0] 211369 ms: Mark-sweep (reduce) 2039.2 (2082.9) -> 2038.6 (2083.4) MB, 2201.3 / 0.0 ms (average mu = 0.085, current mu = 0.013) allocation failure scavenge might not succeed
[7332:000001A3BF8073C0] 213807 ms: Mark-sweep (reduce) 2039.7 (2083.4) -> 2038.9 (2083.9) MB, 2432.5 / 0.0 ms (average mu = 0.046, current mu = 0.002) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF6D0B9BD2F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+112159
2: 00007FF6D0B2CD66 v8::internal::WebSnapshotDeserializer::context_count+65430
3: 00007FF6D0B2DC1D node::OnFatalError+301
4: 00007FF6D1467BBE v8::Isolate::ReportExternalAllocationLimitReached+94
5: 00007FF6D145283D v8::SharedArrayBuffer::Externalize+781
6: 00007FF6D12D532C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1468
7: 00007FF6D12D2662 v8::internal::Heap::CollectGarbage+3778
8: 00007FF6D12D01B5 v8::internal::Heap::AllocateExternalBackingStore+1909
9: 00007FF6D12F35D1 v8::internal::Factory::NewFillerObject+209
10: 00007FF6D1023175 v8::internal::DateCache::Weekday+1349
11: 00007FF6D14EFF01 v8::internal::SetupIsolateDelegate::SetupHeap+472849
12: 000001A3C26AA381
I'm using your package with path, not with webpack. And I'm using it like this:
I'm importing the worker in my class component like this:
import createFooWorker from 'workerize-loader!../../workers/headerWorker';
import * as headerWorker from '../../workers/headerWorker';
const workerHeader = createFooWorker<typeof headerWorker>();
and I'm using it like this:
componentWillUnmount() {
workerHeader.terminate();
}
async handleCreateExcel() {
const { excelData } = this.state;
await workerHeader.getExcelData(excelData);
}
async getNotifications(emitLang = false) {
if (!this.searchingNotifications) {
this.searchingNotifications = true;
updateTaskGridObs.send();
await workerHeader.getNotifications().then((response: any) => {
this.setState(
{
notifications: is.existy(response) && hasItems(response.Result) ? response.Result : [],
},
() => {
this.searchingNotifications = false;
if (emitLang) this.props.i18n.changeLanguage(this.state.selectedLang);
},
);
});
}
}
I've defined the module package in my typings.d.ts like this (I've found this code looking the package isssues):
declare module 'workerize-loader!*' {
type AnyFunction = (...args: any[]) => any;
type Async<F extends AnyFunction> = (...args: Parameters<F>) => Promise<ReturnType<F>>;
type Workerized<T> = Worker & { [K in keyof T]: T[K] extends AnyFunction ? Async<T[K]> : never };
function createInstance<T>(): Workerized<T>;
export = createInstance;
}
I've also tried to increase the memory with: SET NODE_OPTIONS=--max_old_space_size=8192, but didn't solve the problem.
I don't understand what I'm doing wrong,. any help will be apreciated. Thanks in advance
- Lenguaje dominante
- JavaScript
- Estrellas
- 2.3k
- Forks
- 85
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de developit/workerize-loader
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
developit/workerize-loader#131 · 6 comentarios · 1 reacción ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
developit/workerize-loader#130 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 52/100
developit/workerize-loader#129 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
developit/workerize-loader#128 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
developit/workerize-loader#126 · 4 comentarios ·
Todos los issues de developit/workerize-loader
Issues similares
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Improve Title Support Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·