When we try and import SpeedInsights component in our /pages/_app.tsx file and deploy through vercel, all pages return the following error:
⨯ file:///var/task/node_modules/@vercel/speed-insights/dist/next/index.mjs:4
import React, { Suspense } from "react";
^^^^^^^^
SyntaxError: Named export 'Suspense' not found. The requested module 'react' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'react';
const { Suspense } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
⨯ null
⨯ file:///var/task/node_modules/@vercel/speed-insights/dist/next/index.mjs:4
import React, { Suspense } from "react";
^^^^^^^^
SyntaxError: Named export 'Suspense' not found. The requested module 'react' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'react';
const { Suspense } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
null
Error: Runtime exited with error: exit status 1
Runtime.ExitError