question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot redefine property: default

See original GitHub issue

Using Node 12.16.1, TypeScript 3.8.3, and tslib 1.12.0 I’m seeing this error:

/Users/phensley/dev/cldr-engine/node_modules/tslib/tslib.js:237
        Object.defineProperty(o, "default", { enumerable: true, value: v });
               ^
TypeError: Cannot redefine property: default
    at Function.defineProperty (<anonymous>)
    at /Users/phensley/dev/cldr-engine/node_modules/tslib/tslib.js:237:16
    at Object.__importStar (/Users/phensley/dev/cldr-engine/node_modules/tslib/tslib.js:246:9)
    at Object.<anonymous> (/Users/phensley/dev/cldr-engine/packages/cldr-compiler/lib/cli/compiler/index.js:4:21)

Occurs when __importStar is called: import * as yargs from 'yargs';

Transpiled to: var yargs = tslib_1.__importStar(require("yargs"));

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:12
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

23reactions
kamilmysliwieccommented, May 13, 2020

Ahh yeah, tslib 1.12.0 expects some emit concessions provided by TS 3.9 (namely hoisted export names) without which some stuff won’t work as expected. We probably need to adjust our messaging/versioning.

@weswigham if there’s any breaking change introduced, it would be nice if a new release could be published with a major version update. This minor release broke a lot of packages that the community heavily depends on.

@DanielRosenwasser Please, consider reverting this release till the reasonable alternative is found.

13reactions
weswighamcommented, May 13, 2020

Howdy everyone - if you’re still working with TS <= 3.8, the new tslib version 1.13.0 should fix the issues you were having; it does not support live bindings, but should continue to work with both older and newer emit without a runtime error. The newly published tslib 2.0.0 has the contents of the former 1.12.0, and provides support for live bindings alongside TS 3.9+ emit; so nobody should be installing it by accident in existing projects anymore~ Sorry for the inconvenience everyone ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot redefine property: default #38679 - GitHub
I've tried both with and without esModuleInterop on, and can't replicate your result.
Read more >
TypeError: can't redefine non-configurable property "x"
The JavaScript exception "can't redefine non-configurable property" occurs when it was attempted to redefine a property, but that property is non-configurable.
Read more >
Why can't I redefine a property in a Javascript object?
You are unable to redefine the property because Object.defineProperty() defaults to non-configurable properties, from the docs: configurable.
Read more >
awslabs/aws-cdk - Gitter
Unable to determine the default AWS account (did you configure "aws configure"?): TypeError: Cannot redefine property: default.
Read more >
How to solve "Cannot redefine property: handler" on AWS ...
Hey, there! Today I spent a good few hours trying to solve a problem on AWS Lambda and given how deep... Tagged with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found