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

[vite:build-import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax #82

Closed
vejja opened this issue Mar 4, 2024 · 1 comment

Comments

@vejja
Copy link

vejja commented Mar 4, 2024

Bug reported in Nuxt-Security : Baroshem/nuxt-security#390
Original issue in Nuxt core : nuxt/nuxt#26011

OP had the initial code with console.log statement:

onUnmounted(() => {
    removeCardServiceSubscription(cardServicesSubscription)
    console.log("🚀 ~ onUnmounted ~ removeCardServiceSubscription(cardServicesSubscription):", removeCardServiceSubscription(cardServicesSubscription))
});

The plugin transformed the initial code by cutting out the beginning of the console.log statement :

[vite:build-import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax. Install @vitejs/plugin-vue to handle .vue files.
file: D:/proj/components/details/Index.vue:205:64
203: onUnmounted(() => {
204:     removeCardServiceSubscription(cardServicesSubscription)
205:     :", removeCardServiceSubscription(cardServicesSubscription))
                                                                     ^
206: });

Line 205 is indeed invalid Javascript

@Talljack
Copy link
Owner

Talljack commented Mar 9, 2024

fixed in V1.0.0, please upgrade the version and use it, thank you.

@Talljack Talljack closed this as completed Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants