infernojs / create-inferno-app

Create Inferno apps with no build configuration.
MIT License
351 stars 34 forks source link

My function call transpiled to (void, 0) #77

Closed sprlwrksAprilmintacpineda closed 11 months ago

sprlwrksAprilmintacpineda commented 6 years ago

From

image

To

image

It happens when I do this:

if (!cookie || cookie < Date.now()) {
    function isPortrait () {
      // .. codes
    }

    function displayCorrectSplashImage () {
      // .. codes
    }

    // ... rest of the codes
}

Notice the displayCorrectSplashImage function, that's the one with the issue. If I move it out of the if statement like so:

function isPortrait () {
  // .. codes
}

function displayCorrectSplashImage () {
  // .. codes
}

if (!cookie || cookie < Date.now()) {
    // ... rest of the codes
}

It then transpiles into this:

image

Which is the working one.

sprlwrksAprilmintacpineda commented 6 years ago

@Havunen I'm not sure if this is a problem with inferno-script or tools that it uses.

Havunen commented 11 months ago

I have rebased all updates from the upstream, updated all the depencies to latest versions and converted the source code to ESM. The next major version will require Node 20 or newer.

This issue will most likely be fixed after upgrading one of these dependencies. Closing.