Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

adapter-node: Add a shebang to `build/index.js`

Open Beginner friendly
#17,534 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
build-system

Research direction

Find the code that generates build/index.js and check how that output is covered by existing tests. Start by searching the repository for adapter-index.js and the adapter-node build entry point. Done means the generated file begins with the Node shebang and the relevant tests pass.

Written by the indexing model from the issue text.

Description

awaiting submitter
Describe the problem

I'm trying to package a SvelteKit app, but I get this error:

❯ pnpm run package
$ svelte-kit sync && svelte-package && publint
src/lib -> dist
Running publint v0.3.25 for @natoboram/leanish...
Packing files with `pnpm pack`...
Linting...
Errors:
1. pkg.bin.leanish is build/index.js but the file is not executable. It should start with a shebang, e.g. #!/usr/bin/env node.
[ELIFECYCLE] Command failed with exit code 1.

And indeed, build/index.js contains only this:

export * from './server/adapter-index.js';
Describe the proposed solution

The generated file should instead look like this:

#!/usr/bin/env node
export * from './server/adapter-index.js';
Alternatives considered

Making a Vite plugin:

function nodeShebang(): Plugin {
	return {
		name: 'node-shebang',
		apply: 'build',
		enforce: 'post',
		buildApp: {
			order: 'post',
			handler: async () => {
				const file = 'build/index.js'
				const content = await readFile(file, 'utf8')
				if (content.startsWith('#!')) return
				await writeFile(file, `#!/usr/bin/env node\n${content}`)
			},
		},
	}
}
Importance

nice to have

Additional Information
Dominant language
JavaScript
Stars
20.9k
Forks
2.4k
Avg merge
1d 23h
Merged PRs (30d)
89

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sveltejs/kit

All issues in sveltejs/kit

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.