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

Migration adds invalid migration task when non-keyword export is present in the page script body #8518

Closed
taylorzane opened this issue Jan 13, 2023 · 0 comments · Fixed by #8537
Labels
bug Something isn't working contributions-welcome We're not going to implement this ourselves, but we'll consider contributions
Milestone

Comments

@taylorzane
Copy link

Describe the bug

When migrating routes using npx svelte-migrate routes, if a file that is being migrated contains the text export anywhere in the <script> body a @migration task: Add data prop error will be inserted. This is to be expected when it is used as a keyword, but it should not trigger if it is used for any other reason.

Reproduction

  1. Create a SvelteKit project using 1.0.0-next.405 (or older) with the following contents:
<!-- src/routes/test.svelte -->
<div>
  <DataExport></DataExport>
</div>

<script>
  import DataExport from '$lib/data_export.svelte'
</script>

The contents of $lib/data_export.svelte is irrelevant, and technically doesn't even need to exist to reproduce.

  1. Run npx svelte-migrate routes

Let me know if you want a reproduction repository. The issue seemed self-evident enough to not require one.

Logs

N/A

System Info

N/A

Severity

annoyance

Additional Information

No response

@dummdidumm dummdidumm added bug Something isn't working contributions-welcome We're not going to implement this ourselves, but we'll consider contributions labels Jan 13, 2023
@Rich-Harris Rich-Harris added this to the whenever milestone Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working contributions-welcome We're not going to implement this ourselves, but we'll consider contributions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants