#i keep getting errors when using googleapi package

1 messages · Page 1 of 1 (latest)

hazy crane
#
  • warn ./node_modules/debug/src/node.js
    Module not found: Can't resolve 'supports-color' in 'D:\WebDev\learning\FrameWork\nextjs\googleAnalytics\node_modules\debug\src'

Import trace for requested module:
./node_modules/debug/src/node.js
./node_modules/debug/src/index.js
./node_modules/https-proxy-agent/dist/index.js
./node_modules/gaxios/build/src/gaxios.js
./node_modules/gaxios/build/src/index.js
./node_modules/googleapis-common/build/src/index.js
./node_modules/googleapis/build/src/index.js
./app/utils/extra/settings.js
./app/api/analytics/route.js

./node_modules/node-fetch/lib/index.js
Module not found: Can't resolve 'encoding' in 'D:\WebDev\learning\FrameWork\nextjs\googleAnalytics\node_modules\node-fetch\lib'

Import trace for requested module:
./node_modules/node-fetch/lib/index.js
./node_modules/gaxios/build/src/gaxios.js
./node_modules/gaxios/build/src/index.js
./node_modules/googleapis-common/build/src/index.js
./node_modules/googleapis/build/src/index.js
./app/utils/extra/settings.js
./app/api/analytics/route.js

./node_modules/retry-request/index.js
Module not found: Can't resolve 'request' in 'D:\WebDev\learning\FrameWork\nextjs\googleAnalytics\node_modules\retry-request'

Import trace for requested module:
./node_modules/retry-request/index.js
./node_modules/google-gax/build/src/streamingCalls/streaming.js
./node_modules/google-gax/build/src/index.js
./node_modules/@google-analytics/data/build/src/v1alpha/alpha_analytics_data_client.js
./node_modules/@google-analytics/data/build/src/v1alpha/index.js
./node_modules/@google-analytics/data/build/src/index.js
./app/utils/extra/settings.js
./app/api/analytics/route.js

brisk crestBOT
#
Warn <User:Mention/ID> <Reason:Text>

Invalid arguments provided: Improper mention "./node_modules/debug/src/node.js\nModule"

mystic oasisBOT
#

Hi @hazy crane. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

The errors you're encountering are related to the 'module not found' issue. This error occurs when the static import statement cannot find the file at the declared path. It's often caused by letter-casing inconsistencies in your filename(s) between your repository and local machine, or both.

One possible cause for this issue is the fact that some filesystems are case-insensitive, however Vercel deployments use a case-sensitive filesystem. This means that when you change the letter-casing in filenames on your local machine, Git will only pick up changes in your respective static import statements. This would mean that your repository is now syntactically incorrect, resulting in a build error when deploying the repository on the Vercel platform.

To resolve this issue, you should check your build logs, which will indirectly point to the file that is causing the issue. Make sure that your file's letter-casing correctly matches with its respective static imports. Also, ensure that your letter-casing in your filenames and imports are identical between your repository and local machine. If you are using git, make sure git config core.ignorecase false is set in your environment.

For more information, you can refer to the Vercel Guide on how to resolve a 'module not found' error (https://vercel.com/guides/how-do-i-resolve-a-module-not-found-error).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@hazy crane kapa.ai is still learning and improving, please let us know how it did by reacting below

hazy crane
#

@mystic oasiswhere do i put experimental.esmExternals: 'loose' ?

mystic oasisBOT
#

Let me check the knowledge base for you. One moment! :books:

#

You can put experimental.esmExternals: 'loose' in your next.config.js file. Here's how you can do it:

module.exports = {
  experimental: {
    esmExternals: 'loose',
  },
}

This configuration goes under the experimental property in the exported object of your next.config.js file. Please note that this is an experimental feature and may have potential changes in future updates of Next.js.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: