Vercel Speed analysis did not complete successfully

Issues with implementing Speed Insights on a Vercel deployment have arisen as an error is encountered during the build process. The error message reads:

Failed to compile.
./node_modules/@vercel/speed-insights/dist/next/index.mjs
Module not found: Can't resolve 'next/navigation.js' in '/vercel/path0/node_modules/@vercel/speed-insights/dist/next'

To address this, I have installed the required dependencies using:

yarn add @vercel/speed-insights

In addition, I have included the SpeedInsights component in _app.tsx through the following code snippet:

import React from 'react';
import '../styles/global.css';
import Head from 'next/head';
import { Analytics } from '@vercel/analytics/react'
import { SpeedInsights } from '@vercel/speed-insights/next';

const App = ({ Component, pageProps }) => {
  const inputRef = React.useRef<HTMLInputElement>(null);

  const onClickAnywhere = () => {
    inputRef.current.focus();
  };

  return (
    <>
      <Head>
        <meta
          name="viewport"
          content="initial-scale=1.0, width=device-width"
          key="viewport"
          maximum-scale="1"
        />
      </Head>

      <div
        className="text-light-foreground dark:text-dark-foreground min-w-max text-xs md:min-w-
        full md:text-base"
        onClick={onClickAnywhere}
      >
        <main className="bg-light-background dark:bg-dark-background w-full h-full p-2">
          <Component {...pageProps} inputRef={inputRef} />
        </main>
      </div>
      <Analytics />
      <SpeedInsights />
    </>
  );
};

Your assistance in resolving this issue would be greatly appreciated.

Answer №1

Dealing with the same issue, I decided to include a new next package into my project.

npm install next

Alternatively,

yarn add next

This resolved the console complaint for me. However, upon running the project, I encountered a different error in the browser. It seems that it may not offer seamless support for Vue projects in general.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How to specifically activate window resize when the width changes

I am looking to implement custom styling on an element based on the current screenWidth of the window. This can be achieved using the following @HostListener: @HostListener('window:resize', ['$event']) public resize() { // Apply ...

Can one obtain a comprehensive array of interfaces or a detailed map showcasing all their variations?

I have developed a method that takes in an object containing data and returns an object that adheres to a specific interface. interface FireData { id: EventTypes; reason?: string; error?: string; } enum EventTypes { eventType1 = "ev1", ...

Looking for the final entry in a table using AngularJS

Hey everyone, I'm dealing with a table row situation here <tbody> <tr *ngFor="let data of List | paginate : { itemsPerPage: 10, currentPage: p }; let i = index"> <td>{{ d ...

Optimal strategies for managing subscriptions in Angular

I'm currently pondering about the concept of angular subscription and unsubscription. The amount of information available on this topic is overwhelming, making it hard for me to navigate through. When is the right time to unsubscribe from a subscript ...

Creating a dynamic list in Typescript from a tuple array without any intersections

const colors = ["red", "blue", "green", "yellow"] as const; const buttonSizes = ["small", "medium", "large"] as const; type ColorType = (typeof colors)[number]; type SizeType = (typeof b ...

Is there a way to extract a token from the URL in a Nextjs/React application?

I am currently developing a project that relies heavily on API integration. My front-end interface is built using React and Next.js, while the back-end API is developed with Laravel. Within my front-end page, I have implemented a token in the URL to help ...

Discovering the largest element within a group to establish the height for the rest

There is a component mapping card elements that look like this: https://i.stack.imgur.com/CktsE.png The topmost, leftmost card appears to be missing some height compared to others. Is there a way to determine the height of the tallest components and then ...

Passing the unique identifier of a record in NextJS to a function that triggers a modal display

I'm currently facing an issue with my NextJS component that displays a list of people. I have implemented a delete button which triggers a modal to confirm the deletion of a person, but I am struggling with passing the id of the person to be deleted. ...

Unable to update a single object within an array using the spread operator

I am currently working on updating an object within an array and have encountered some issues. In my initial code, I successfully updated a specific property of the object inside the array like this: var equipment = this.equipments.find((e) => e.id === ...

New update in Typescript causing compatibility issue with Node.attributes

I've come across some older Typescript code that parses through XML documents. It often references Nodes and their attributes, like so: var attribs = node.attributes; Recently, with the updated TS version (2.8.1), I've noticed this 'attrib ...

"Utilizing Typescript and React to set a property's value based on another prop: A step-by

Is there a way to create a dynamic prop type in React? I have an Alert component with various actions, such as clicking on different components like Button or Link. I am looking for a solution like this: <Alert actions={[{ component: Link, props: { /* ...

Passport.js does not provide authentication for server-side asynchronous requests

Recently, I configured Passport.js with the local-strategy on my express server. Interestingly, when I am logged in and send an asynchronous request within NextJS's getInitialProps, it allows the GET request through client-side rendering but not serv ...

A warning was raised due to an unhandled promise rejection, stating that the AbortController is not defined

After updating my Discord Bot code from js v12 to v13 and ensuring that my node.js is up to date, I encountered an issue when running the Bot on Heroku. Whenever I push new changes, an error stating UnhandledPromiseRejectionWarning: ReferenceError: AbortCo ...

Refreshing the data displayed in an Angular 9 Material Table generated through a CLI command

My application allows users to upload files, perform backend operations, and receive a list of JSON Objects in return. I have created a material table to display this data. However, I am facing an issue where the dataSource of my material table is not upda ...

ionChange - only detect changes made in the view and update the model in Ionic 2

In my Ionic 2 application, I have a feature that allows users to schedule notifications as reminders. The requirements for this feature are as follows: Upon entering the reminder page, it should check if there is a saved reminder. If a reminder is saved ...

Is it possible to verify if the @Output is correctly wired up within an Angular component?

When working with Angular and TypeScript, it is possible to access the bound @Input values in the ngOnInit method of a component. However, there isn't a straightforward way to check if a particular @Output event binding has been set up on the componen ...

What makes TypeScript unique is that it is completely written in TypeScript, with TypeScript accounting for 100

According to information on the TypeScript repository on GitHub, it consists of 100.0% TypeScript files (.ts) https://i.sstatic.net/Is7XE.png I am curious about how TypeScript is able to compile itself to JavaScript without any external help. Can you exp ...

Using TypeScript's conditional types for assigning types in React

I'm tasked with creating a component that can belong to two different types. Let's call them Type A = { a: SomeCustomType } Type B = { b: SomeOtherDifferentType } Based on my understanding, I can define the type of this component as function C ...

Encountering Next.js Hydration Issue when Using Shadcn Dialog Component

While working on a Next.js project, I came across a hydration error when utilizing the Shadcn Dialog component. The specific error message reads: "Hydration failed because the initial UI does not match what was rendered on the server." Highligh ...

A circular reference occurs when a base class creates a new instance of a child class within its own definition

My goal is to instantiate a child class within a static method of the base class using the following code: class Baseclass { public static create(){ const newInstance = new Childclass(); return newInstance; } } class Childclass ex ...