-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Past Issues Searched
- I have searched open and closed issues to make sure that the bug has not yet been reported
Issue is a Bug Report
- This is a bug report and not a feature request, nor asking for self-hosted support
Using official Plausible Cloud hosting or self-hosting?
Plausible Cloud from plausible.io
Describe the bug
I installed the npm package as described in the docs.
When running the dev server locally i get Failed to resolve entry for package "@plausible-analytics/tracker". The package may have incorrect main/module/exports specified in its package.json. in the logs. I cant even start the dev server.
I'm using vite 7.0.6
EDIT: Here is https://publint.dev/@plausible-analytics/[email protected] with some info, perhaps this is the issue:
"module": "./plausible.js" ,
pkg.module is used to output ESM, but pkg.exports is not defined. As Node.js doesn't read pkg.module, the ESM output may be skipped. Consider adding pkg.exports to export the ESM output. pkg.module can usually be removed alongside too. (This will be a breaking change) (More info)
EDIT 2: I realized that I should add some context on how I use it. I am using sveltekit and only callning init on mount (client side).
import { init } from '@plausible-analytics/tracker'
import { onMount } from 'svelte'
const { children } = $props()
onMount(() => {
init({ domain: '<mydomain>' })
})Expected behavior
To work.
I have also tried deleting node_modules, package-lock.json and doing npm i without success.
Screenshots
No response
Environment
- OS: Fedora 42
- Browser: Firefox
- Browser Version: 144.0willyfromtheblock
Metadata
Metadata
Assignees
Labels
No labels