-
Notifications
You must be signed in to change notification settings - Fork 508
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
"require is not defined" after moving to ESM and rollup #1017
Comments
I went down the rabbit hole on this one and think I found the issue. Most of the
The main issue I see is one of your project's dependencies,
Obviously, the fallback separator Testing with a simple clone of this repo, I set the following override re-packaged the action. The end result is no more erroneous // package.json
{
// ...
"overrides": {
"@actions/glob": {
"minimatch": "^10.0.1"
}
} I can't guarantee this will work 100% for you, but it should at least resolve the immediate error you're seeing. In the meantime, I opened an issue in the |
Hi @ncalteen, This is the first time I come across rollup and I'm actually surprised that it even outputs these |
Have you tried setting // See: https://rollupjs.org/introduction/
import commonjs from '@rollup/plugin-commonjs'
import nodeResolve from '@rollup/plugin-node-resolve'
import typescript from '@rollup/plugin-typescript'
const config = {
input: 'src/index.ts',
output: {
esModule: true,
file: 'dist/index.js',
format: 'es',
sourcemap: true
},
plugins: [
typescript(),
nodeResolve({ preferBuiltins: true }),
commonjs({ ignoreTryCatch: false })
]
}
export default config |
FYI, the reason I haven't included that in the template is because of the following:
|
We try and adopt template updates in our action from time to time and Convert to ESM and use rollup has caused an issue on Windows related to rollup/rollup#3434. Looking at the dist/index.js of this template, I also see a bunch of
require
calls. So this might also be an issue in this template.I tried using
transformMixedEsModules=true
in here but that didn't seem to fix the problem.Any help with this is appreciated!
Pinging @ncalteen because he's the author of #969.
The text was updated successfully, but these errors were encountered: