Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esModuleInterlop not used in secondary file #621

Closed
EndBug opened this issue Dec 6, 2020 · 1 comment
Closed

esModuleInterlop not used in secondary file #621

EndBug opened this issue Dec 6, 2020 · 1 comment

Comments

@EndBug
Copy link

EndBug commented Dec 6, 2020

My code has two files, that look like this:

// main.ts
import path from 'path' // This uses esModuleInterlop, and doesn't cause issues
import { setOutput } from './util'

path.normalize('') // OK
setOutput('a', 'b') // Cannot read property 'setOutput' of undefined
// util.ts
import core from '@actions/core' // This should use esModuleInterlop too, but I get an error

export function setOutput(a, b) {
  return core.setOutput(a, b)
}

The error I'm showing in the code ("Cannot read property 'setOuput' of undefined") only happens when I use the build, there are no compile errors. Since this is the code of a GitHub Action, I have no way of running this code locally before NCC compiles it.

I know that the issue is with esModuleInterlop because I solved it by using import * as core from '@actions/core'

Do you have any clue on what could I have been doing wrong?

@guybedford
Copy link
Contributor

This seems like a duplicate of #626, will address this there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants