问题
I am trying to run next.js project with @google-cloud/bigquery client library/
I get below error when running the project.
TypeError: Unexpected error determining execution environment: process.emitWarning is not a function
here is my next.config.js
module.exports = {
webpack: (config, { isServer }) => {
// Fixes npm packages that depend on `fs` module
if (!isServer) {
config.node = {
...config.node,
fs: "empty",
child_process: "empty",
net: "empty",
tls: "empty",
};
}
return config;
},
env: {
GREETING: process.env.GREETING,
},
};
package.json:
{
"name": "testiot",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@google-cloud/bigquery": "^5.5.0",
"dotenv": "^8.2.0",
"fs": "^0.0.1-security",
"next": "10.0.5",
"next-images": "^1.7.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"request": "^2.88.2",
"retry-request": "^4.1.3"
}
}
GREETING message is able to print but it gives me the error in console.
来源:https://stackoverflow.com/questions/65866071/next-js-with-google-cloud-bigquery-unexpected-error-determining-execution-env