Github Repo
I am getting the TypeError: Cannot read properties of undefined (reading ‘prototype’) at ./node_modules/http2/lib/protocol/framer.js, based on the code, I believe the issue lies in the framer.js, but I cannot get to this file due to the fact that http2 is not in the node modules, but it is in my package.json.
Dependencies “dependencies”: {
“@testing-library/jest-dom”: “^5.17.0”,
“@testing-library/react”: “^13.4.0”,
“@testing-library/user-event”: “^13.5.0”,
“assert”: “^2.0.0”,
“browserify-zlib”: “^0.2.0”,
“buffer”: “^6.0.3”,
“crypto-browserify”: “^3.12.0”,
“dotenv”: “^10.0.0”,
“google-auth-library”: “^9.9.0”,
“googleapis”: “^135.0.0”,
“http2”: “^3.3.7”,
“http2-wrapper”: “^2.2.1”,
“https”: “^1.0.0”,
“https-browserify”: “^1.0.0”,
“install”: “^0.13.0”,
“ml5”: “^0.12.2”,
“npm”: “^10.5.2”,
“os”: “^0.1.2”,
“os-browserify”: “^0.3.0”,
“path-browserify”: “^1.0.1”,
“querystring-es3”: “^0.2.1”,
“react”: “^18.2.0”,
“react-dom”: “^18.2.0”,
“react-p5”: “1.4.1”,
“react-router-dom”: “^6.22.3”,
“stream”: “^0.0.2”,
“stream-browserify”: “^3.0.0”,
“stream-http”: “^3.2.0”,
“url”: “^0.11.3”,
“web-vitals”: “^2.1.4″`
/* config-overrides.js */
const webpack = require('webpack');
const path = require('path');
module.exports = function override(config, env) {
//do stuff with the webpack config...
config.resolve.fallback = {
url: require.resolve('url'),
assert: require.resolve('assert'),
crypto: require.resolve('crypto-browserify'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
os: require.resolve('os-browserify/browser'),
buffer: require.resolve('buffer'),
stream: require.resolve('stream-browserify'),
http2: require.resolve('http2'),
"querystring": require.resolve("querystring-es3"),
net: false,
fs: false,
tls: require.resolve('tls'),
child_process: false,
"path": require.resolve("path-browserify"),
"zlib": require.resolve("browserify-zlib"),
};
config.plugins.push(
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer'],
}),
);
return config;
}
How would I solve this error, and why is http2 not showing up in the node modules despite being installed.