Skip to content

Build randomly fails with [vue-sfc-transformer] Failed to load the template block in /path/to/component.vue #40

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

Closed
mattmess1221 opened this issue May 1, 2025 · 2 comments · Fixed by #41
Assignees
Labels
bug Something isn't working

Comments

@mattmess1221
Copy link

🐛 The bug

I added a patch to write some variables to a file on a failure and ended up with this.

{
  "batchInputSplitter": "\nsplitter(0.0008225326056232607);\n",
  "batchInput": "wrapper_5(label && !icon);\nsplitter(0.0008225326056232607);\nwrapper_5(cn(\n          'avatar-label',\n          una?.avatarLabel,\n        ));\nsplitter(0.0008225326056232607);\nwrapper_5(cn(\n          'avatar-icon',\n          una?.avatarIcon,\n        ));\nsplitter(0.0008225326056232607);\nwrapper_5(omitProps(props, ['label', 'una', 'icon']));\nsplitter(0.0008225326056232607);\nwrapper_5(cn(\n      'avatar-fallback',\n      una?.avatarFallback,\n      props.class,\n    ));",
  "batchOutput": "wrapper_5(label && !icon);\nsplitter(8225326056232607e-19);\nwrapper_5(cn(\n  \"avatar-label\",\n  una?.avatarLabel\n));\nsplitter(8225326056232607e-19);\nwrapper_5(cn(\n  \"avatar-icon\",\n  una?.avatarIcon\n));\nsplitter(8225326056232607e-19);\nwrapper_5(omitProps(props, [\"label\", \"una\", \"icon\"]));\nsplitter(8225326056232607e-19);\nwrapper_5(cn(\n  \"avatar-fallback\",\n  una?.avatarFallback,\n  props.class\n));\n"
}

When batchInputSplitter contains a very small float, the transformer appears to parse it out and replace it with the scientific notation equivalent. This causes the batchOutput.split(batchInputSplitter) call return a single-length array, causing a false syntax error.

🛠️ To reproduce

N/a

🌈 Expected behaviour

N/a

ℹ️ Additional context

No response

@mattmess1221 mattmess1221 added the bug Something isn't working label May 1, 2025
@Teages Teages self-assigned this May 2, 2025
@Teages Teages linked a pull request May 2, 2025 that will close this issue
@Teages Teages closed this as completed in #41 May 2, 2025
@Teages
Copy link
Collaborator

Teages commented May 2, 2025

thank you ❤️

@mattmess1221
Copy link
Author

This is still an issue in 0.1.15

{
  "batchInputSplitter": "\nsplitter(431458000);\n",
  "batchInput": "wrapper_2(-1);\nsplitter(431458000);\nwrapper_2(cn(\n      'sidebar-rail',\n      props.una?.sidebarRail,\n      props.class,\n    ));",
  "batchOutput": "wrapper_2(-1);\nsplitter(431458e3);\nwrapper_2(cn(\n  \"sidebar-rail\",\n  props.una?.sidebarRail,\n  props.class\n));\n"
}

Now it's not a decimal, but still converting to scientific notation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants