Comments (10)
Looks good now, thanks for the quick fix!
from analytics.
Sure:
"jest": "^29.7.0",
"@vercel/analytics": "^1.2.1",
"@types/jest": "^29.5.12",
"@types/react": "^18.2.56",
"react": "^18.2.0",
"next": "^14.1.0",
"@swc/core": "^1.4.2",
"@swc/jest": "^0.2.36",
Error:
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
Using @swc/jest
as transform for ESM support.
Was working fine in 1.2.0 (and versions prior to that), tests stopped passing with automated workflow to update to 1.2.1
from analytics.
Hey @feugy, sure! Steps to repro in #134
# Install deps ignoring pnpm workspace and install ts-node to run `jest.config.ts`
pnpm --ignore-workspace install -D ts-node
pnpm test
# Tests will fail
pnpm --ignore-workspace install @vercel/[email protected]
pnpm test
# Tests will pass
from analytics.
Thanks for the bug report. I've published version 1.2.1
Would you mind trying it @Mause?
from analytics.
For posterity, would you mind telling me how to reproduce the error?
Including node/next versions, and whether you're using turbo.
Thanks a million.
from analytics.
Just updated to 1.2.1
and it seems that jest
didn't like this change. Haven't checked out yet but felt as giving a warning here 😉
from analytics.
Thank you @SferaDev. Can you tell us more about your setup, including versions?
from analytics.
Thank you @SferaDev. I've enhanced our Next.js app and added tests, trying to reproduce this.
But no luck (jest/swc have no issue parsing files). Would you mind checking #134 and telling me how to reproduce it?
from analytics.
Thanks for the help @SferaDev.
I could reproduce and fix it, by exporting CJS code when running on Node. however it's a bit unfair, since the docs says that we could either use CJS or ESM. I guess it's a nasty combination of jest, ts-node and node.
I'm waiting for an approver, and I'll release this.
from analytics.
I've released 1.2.2, please try and let me know
from analytics.
Related Issues (20)
- Support for Arc Browser HOT 2
- User Opt in feature HOT 2
- Redirect / rename scripts? HOT 7
- Can't use server track in Remix HOT 5
- @vercel/analytics throws errors HOT 4
- Error 400 when using analytics/server track in server actions HOT 2
- Vercel build failed with Turborepo and multiple apps deployed HOT 5
- Vercel Analytics Endpoints HOT 1
- Docs: Specify if `track` runs in development mode or not HOT 1
- Page changes are no longer tracked in SvelteKit 2 HOT 9
- Feature Request: Allow nonce as optional prop in analytics component for content security policy HOT 1
- Integration with Docusaurus HOT 1
- Module resolution warnings under Yarn PnP: `Unable to resolve path to module '@vercel/analytics/react'.eslintimport/no-unresolved` HOT 5
- City-Level analytics HOT 2
- Feature request: Exports HOT 2
- Cannot install the latest version of `@vercel/analytics` with `[email protected]` HOT 2
- Request Bodies with "o" Object Should be Encoded HOT 6
- Custom events does not work in the error boundary HOT 3
- Custom events from routes / SSR HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from analytics.