Duplicates
Latest version
Current behavior 😯
Ran into an issue with unused variables in @solidjs/start@2.0.0-alpha.3.
- Unused errors in catch block
export function get_lucky() {
"use server";
try {
if (Math.random() > 0.5) return true;
throw new Error("Unlucky");
} catch (error) {
// BUG: Expected a semicolon (Note that you need plugins to import files that are not JavaScript)
// noop(error);
return false;
}
}
- Unused destructured variable
export function load_items() {
"use server";
const items = [];
for (const { _id, ...rest } of raw_items) {
// BUG: Property left of ForOfStatement expected node to be of a type ["VariableDeclaration","LVal"] but instead got undefined
// noop(_id);
items.push(rest);
}
return items;
}
When the noop() calls are commented out the compilation fails.
If the variables are used it works as expected.
It also works with @solidjs/start@2.0.0-alpha.2.
Here is a StackBlitz that reproduces the error.
Duplicates
Latest version
Current behavior 😯
Ran into an issue with unused variables in
@solidjs/start@2.0.0-alpha.3.When the
noop()calls are commented out the compilation fails.If the variables are used it works as expected.
It also works with
@solidjs/start@2.0.0-alpha.2.Here is a StackBlitz that reproduces the error.