Skip to content

ReferenceError: Cannot access 'StateContext' before initialization #51469

Open
@khteh

Description

@khteh

Version

v21.5.0

Platform

Linux khteh-p17-2i 6.5.0-14-generic #14-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 14 14:59:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

I have a Node.JS project with 3 separate modules. I define a class in one of the module, rollup the *.ts files, and when run, hit the following error:

$ n start

> [email protected] start
> export NODE_ENV=development&& node --experimental-specifier-resolution=node build/src/webapi/server.js

ReferenceError: Cannot access 'StateContext' before initialization
    at file:///usr/src/Node.JSRestAPI/src/webapi.core/build/index.js:622:54
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:120:12)

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

No response

What do you see instead?

$ n start

> [email protected] start
> export NODE_ENV=development&& node --experimental-specifier-resolution=node build/src/webapi/server.js

ReferenceError: Cannot access 'StateContext' before initialization
    at file:///usr/src/Node.JSRestAPI/src/webapi.core/build/index.js:622:54
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:120:12)

Additional information

https://github.com/khteh/Node.JSRestAPI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions