Skip to content

fix: add @plausible-analytics/tracker to Vite optimizeDeps#47

Merged
johannschopplich merged 1 commit intonuxt-modules:mainfrom
danielroe:fix/tracker-resolution
Feb 25, 2026
Merged

fix: add @plausible-analytics/tracker to Vite optimizeDeps#47
johannschopplich merged 1 commit intonuxt-modules:mainfrom
danielroe:fix/tracker-resolution

Conversation

@danielroe
Copy link
Contributor

@danielroe danielroe commented Feb 25, 2026

@plausible-analytics/tracker only declares a module field in its package.json — it has no main or exports. This causes Vite's import analysis plugin to fail when resolving the package, particularly in Vitest/Nuxt test environments:

Error: Failed to resolve entry for package "@plausible-analytics/tracker".
The package may have incorrect main/module/exports specified in its package.json.

This is breaking CI in nuxt/nuxt.com and nuxt/nuxters with @nuxtjs/plausible v3.

this PR adds @plausible-analytics/tracker to vite.optimizeDeps.include in the module setup so Vite pre-bundles it correctly, regardless of the package's non-standard entry point configuration.

@johannschopplich
Copy link
Collaborator

@danielroe Thank you very much. 🙏

@johannschopplich johannschopplich merged commit aba1070 into nuxt-modules:main Feb 25, 2026
2 checks passed
@danielroe
Copy link
Contributor Author

you are very welcome ❤️

@danielroe danielroe deleted the fix/tracker-resolution branch February 25, 2026 16:36
@johannschopplich
Copy link
Collaborator

Release v3.0.2 is on its way. Hopefully de-breaking the respective CI's.

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

Successfully merging this pull request may close these issues.

2 participants