You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the v2 theme source contains comments, you'll see the following error:
Expected Behavior
By stripping out all comments, the theme will import as expected. Ideally we should strip the comments automatically for users as the raw v2 generator export includes these comments.
Steps To Reproduce
Generate a new v2 theme
Export to a theme.ts file
Try import this via the v3 generator import feature
The theme will fail with the above error
Strip out any and all comments ad import again
The theme will import as expected
Link to Reproduction / Stackblitz
No response
More Information
Reported by user @Fefefo on Discord.
The text was updated successfully, but these errors were encountered:
My sneaky suspicion is that those comments at end of lines in the v2 theme source are causing this trouble. The comments that have their own lines shall be fine.
// This line is fine// primary | #c93655// This line shall not pass "--color-primary-50": "247 225 230",// #f7e1e6
The parsing done in import-file.ts doesn't account for comments at the end of a line.
EDIT: I'm pretty sure that's the cause, it's not a sneaky suspicion.
@phamduylong likely so, but don't worry about this. Hugo has volunteered to upgrade the portion that parses the file contents using the knowledge he's accrued from writing the migration CLI. It's a similar concept reading/parsing file contents, rather than how I'm doing it (reading it as text content).
@Hugos68 I'll go ahead and assign this one to you to represent those changes.
Current Behavior
If the v2 theme source contains comments, you'll see the following error:
Expected Behavior
By stripping out all comments, the theme will import as expected. Ideally we should strip the comments automatically for users as the raw v2 generator export includes these comments.
Steps To Reproduce
theme.ts
fileLink to Reproduction / Stackblitz
No response
More Information
Reported by user
@Fefefo
on Discord.The text was updated successfully, but these errors were encountered: