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

Unexpected Token Error - Importing types in svelte components #11

Closed
WilliamDiakite opened this issue Mar 21, 2022 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@WilliamDiakite
Copy link
Contributor

WilliamDiakite commented Mar 21, 2022

Un bug provoque une erreur lorsqu'on tente d'importer des types (.d.ts) dans un composant ou une route svelte.

Exemple d'erreur

Error:
500: /Users/akira/Documents/Dev/cbc/cbc-client/src/components/AffaireModal.svelte:25:13 Error while preprocessing /Users/akira/Documents/Dev/cbc/cbc-client/src/components/AffaireModal.svelte - Unexpected token

déclenché par la ligne

import type { Affaire } from '$lib/types/affaire';

Autres issues:

EDIT: j'ai ouvert une issue sur carbon-preprocess-svelte. carbon-design-system/carbon-preprocess-svelte#28

@WilliamDiakite WilliamDiakite changed the title Les types .d.ts ne peuvent pas être importés dans un composant ou route Unexpected Error - Importing types Mar 21, 2022
@WilliamDiakite WilliamDiakite changed the title Unexpected Error - Importing types Unexpected Token Error - Importing types in svelte components Mar 21, 2022
@WilliamDiakite WilliamDiakite self-assigned this Mar 21, 2022
@WilliamDiakite WilliamDiakite added the bug Something isn't working label Mar 21, 2022
@WilliamDiakite
Copy link
Contributor Author

Le problème venait de l'ordre dans lequel les preprocess sont appelés. Dans svelte.config.js, preprocess (de Svelte) doit être appelé avant les preprocess de carbon.

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

No branches or pull requests

1 participant