Skip to content

Commit

Permalink
fix(analytics-types): build in next.js (#900)
Browse files Browse the repository at this point in the history
* fix(analytics-types): build in next.js

* fix(analytics-types): build in next.js
  • Loading branch information
Mercy811 authored Oct 21, 2024
1 parent 03c9604 commit 63be8c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion examples/browser/next-app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "next/core-web-vitals"
"extends": "next/core-web-vitals",
"parserOptions": {
"project": "./tsconfig.json"
}
}
1 change: 0 additions & 1 deletion examples/browser/next-app/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { NextPage } from 'next'
import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'
import { identify, setGroup, groupIdentify, track, Identify } from '@amplitude/analytics-browser'

Expand Down
6 changes: 4 additions & 2 deletions packages/analytics-types/src/element-interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export interface Messenger {
// DomElement is [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) if the dom library is included in tsconfig.json
// and never if it is not included
// eslint-disable-next-line no-restricted-globals
type DomElement = typeof globalThis extends { Element: infer T extends abstract new (...args: any) => any }
? InstanceType<T>
type DomElement = typeof globalThis extends {
Element: new (...args: any) => infer T;
}
? T
: never;

0 comments on commit 63be8c3

Please sign in to comment.