bemble
bemble
WWindmill
Created by bemble on 3/21/2025 in #help
No arguments passed to main when relative imports in VSCode Preview
Hi, when I bundle relative path for local preview in VSCode (the only way I found to have relative imports working), when I test my script, arguments are not passed to it. To reproduce, here is a simple script:
import { Language } from "./lib/database/types";

export async function main(languages: string[]) {
return languages ;
}
import { Language } from "./lib/database/types";

export async function main(languages: string[]) {
return languages ;
}
Create a test with parameters. Without the import and so not bundling, no issue, adding the import, not bundling, the preview can't resolve the path, and when bundling, it returns null. Am I missing something?
2 replies