Get support for soyuka/repro-default-export

If you're new to LTH, please see our FAQ for more information on what it is we do.

Support Options

Unfortunately, there are currently no active helpers for this repository on the platform. Until they become available, we reccomend the following actions:

View Open Issues

Take a look to see if anyone else has experienced the same issue as you and if they managed to solve it.

Open an Issue

Make sure to read any relevant guidelines for opening issues on this repo before posting a new issue.

Sponsor directly

Check out the page and see if there are any options to sponsor this project or it's developers directly.

soyuka/repro-default-export

Bug Reproduction repository

Related issues:

Install

run bash init.sh

What's wrong?

In src/index.ts:

import createElement from 'inferno-create-element'
import Component from 'inferno-component'

console.log(createElement)
console.log(Component)

createElement and Component should have the value of the related package default export.

Though, if you run node dist/bundle.js, you'll get undefined

If you check out the compiled file, you will see something like:

const inferno_create_element_1 = __webpack_require__(3);
const inferno_component_1 = __webpack_require__(2);
console.log(inferno_create_element_1.default);
console.log(inferno_component_1.default);

But, rollup (which is used by Inferno) doesn't export any default:

true ? module.exports = factory(__webpack_require__(0)) :
typeof define === 'function' && define.amd ? define(['inferno'], factory) :
(global.Inferno = global.Inferno || {}, global.Inferno.createElement = factory(global.Inferno));

An alternative is to use the following import statements:

import * as createElement from 'inferno-create-element'
import * as Component from 'inferno-component'

console.log(createElement)
console.log(Component)

But by using this, typescript expects Objects and the module signatures are wrong, and therefore blocking the compilation.

For example, you won't be able to extend Component, because it's not recognized as a class.

Version used:

Our Mission

We want to make open source more sustainable. The entire platform was born from this and everything we do is in aid of this.

Interesting Articles

Thank you for checking out LiveTechHelper |
2025 © lth-dev incorporated

p-e622a1a2