We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.2.2+c1708ea6a
Darwin 21.6.0 x86_64 i386
macro.ts
const two = 2 export function add2(n: number) { return n + two }
main.ts
import { add2 } from './macro' with { type: 'macro' } // Works console.log(add2(40)) // Doesn't const data = 40 console.log(add2(data))
bun run main.ts
To be able to use static data from macros.
8 | console.log(add2(data)) ^ error: "Cannot convert identifier to JS. Try a statically-known value" error in macro at .../main.ts:8:13 Bun v1.2.2 (macOS x64)
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What version of Bun is running?
1.2.2+c1708ea6a
What platform is your computer?
Darwin 21.6.0 x86_64 i386
What steps can reproduce the bug?
macro.ts
main.ts
What is the expected behavior?
To be able to use static data from macros.
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: