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

Runtime error #67

Open
lukehaas opened this issue Jan 15, 2025 · 0 comments
Open

Runtime error #67

lukehaas opened this issue Jan 15, 2025 · 0 comments

Comments

@lukehaas
Copy link

I'm seeing the following runtime error when calling the format function.

RuntimeError: memory access out of bounds
    at 6186a877028fe3c3c16f.wasm:0x11ad25
    at 6186a877028fe3c3c16f.wasm:0x1113d4
    at passStringToWasm0 (ruff_fmt.js:62:1)
    at format (ruff_fmt.js:196:1)

Here is the code I'm running:

import init, { format } from '@wasm-fmt/ruff_fmt/ruff_fmt';

await init();

const sampleCode = `
print(1)
`;

const formatted = format(content, {
      indent_style: 'space',
      indent_width: 4,
      line_width: 88,
      quote_style: 'double',
      magic_trailing_comma: 'respect',
 });

The error only occurs if I pass a config option to the format function. Without the config object, it works fine.

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

1 participant