Skip to content

Typescript enum: TypeError: Cannot set properties of undefined #5815

@sirphoenix

Description

@sirphoenix

Rollup Version

4.29.0

Operating System (or Browser)

Chrome

Node Version (if applicable)

No response

Link To Reproduction

https://stackblitz.com/edit/vitejs-vite-p16j6dke?file=package.json

Expected Behaviour

Rendered output should be: "MyEnum.foo: FOO" and no errors in console.

Actual Behaviour

Outputs an empty page and web-console throws this error:
Uncaught TypeError: Cannot set properties of undefined (setting 'foo')

I know this might not be a direct bug of rollup, since it's only installed here as a dependency of vite.
When running "npm start" with rollup v4.29.0 we get the error as setup in the example.
But when changing the overrides to rollup "v4.28.1" everything is fine. (need to re-run "npm start" manually in stackblitz)

Running "npm run dev" is also fine, regardless of the rollup version.
So it is only happening if we build the project while also instrumenting the code using istanbul.
However, it was already determined that vite-plugin-istanbul is not responsible here.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions