My site build seems to work locally but not on Netlify. Is the error at the end of the log below coming from the Netlify next plugin?
Iβm not sure if this is a problem with my location of my util
folder, or my config for functions in my Netlify.toml, or what. Any ideas?
The full site code is at: GitHub - ivanoats/nextweather: Weather station data focused on wind and tide for human powered watercraft
https://nextweather.netlify.app/
11:32:57 AM: Build ready to start
11:32:58 AM: build-image version: be42e453d6c8f171cc2f654acc29c0a8b60e6d93
11:32:58 AM: build-image tag: v3.7.1
11:32:58 AM: buildbot version: 7bdd3b07036ec50a4d44b86fbdc90f52d3e07727
11:32:58 AM: Fetching cached dependencies
11:32:59 AM: Starting to download cache of 1.0GB
11:33:06 AM: Finished downloading cache in 7.233829913s
11:33:06 AM: Starting to extract cache
11:33:47 AM: Finished extracting cache in 41.361791255s
11:33:48 AM: Finished fetching cache in 49.100605268s
11:33:48 AM: Starting to prepare the repo for build
11:33:48 AM: Preparing Git Reference refs/heads/main
11:33:50 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: βUsers/ivan/dev/nextweather/out_publishβ versus β/Users/ivan/dev/nextweather/out_publishβ in the Netlify UI
11:33:50 AM: Different functions path detected, going to use the one specified in the Netlify configuration file: βpages/apiβ versus ββ in the Netlify UI
11:33:51 AM: Starting build script
11:33:51 AM: Installing dependencies
11:33:51 AM: Python version set to 2.7
11:33:51 AM: Started restoring cached node version
11:33:54 AM: Finished restoring cached node version
11:33:55 AM: v12.18.0 is already installed.
11:33:56 AM: Now using node v12.18.0 (npm v6.14.4)
11:33:56 AM: Started restoring cached build plugins
11:33:56 AM: Finished restoring cached build plugins
11:33:56 AM: Attempting ruby version 2.7.1, read from environment
11:33:58 AM: Using ruby version 2.7.1
11:33:58 AM: Using PHP version 5.6
11:33:58 AM: Started restoring cached node modules
11:33:58 AM: Finished restoring cached node modules
11:33:58 AM: Installing NPM modules using NPM version 6.14.4
11:34:08 AM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. Iβll try to do my best with it!npm WARN acorn-export-ns-from@0.1.0 requires a peer of acorn@^6.0.1 but none is installed. You must install peer dependencies yourself.
11:34:08 AM: npm WARN react-native-get-random-values@1.6.0 requires a peer of react-native@>=0.56 but none is installed. You must install peer dependencies yourself.
11:34:08 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
11:34:08 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {βosβ:βdarwinβ,βarchβ:βanyβ} (current: {βosβ:βlinuxβ,βarchβ:βx64β})
11:34:08 AM: added 5 packages from 30 contributors and audited 1038 packages in 9.022s
11:34:09 AM: 68 packages are looking for funding
11:34:09 AM: run npm fund
for details
11:34:09 AM: found 0 vulnerabilities
11:34:09 AM: NPM modules installed
11:34:09 AM: Started restoring cached go cache
11:34:09 AM: Finished restoring cached go cache
11:34:09 AM: go version go1.14.4 linux/amd64
11:34:09 AM: go version go1.14.4 linux/amd64
11:34:09 AM: Installing missing commands
11:34:09 AM: Verify run directory
11:34:11 AM: β
11:34:11 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:34:11 AM: Netlify Build
11:34:11 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:34:11 AM: β
11:34:11 AM: β― Version
11:34:11 AM: @netlify/build 10.2.2
11:34:11 AM: β
11:34:11 AM: β― Flags
11:34:11 AM: deployId: 606a06581e1955000748f9c2
11:34:11 AM: β
11:34:11 AM: β― Current directory
11:34:11 AM: /opt/build/repo
11:34:11 AM: β
11:34:11 AM: β― Config file
11:34:11 AM: /opt/build/repo/netlify.toml
11:34:11 AM: β
11:34:11 AM: β― Context
11:34:11 AM: production
11:34:11 AM: β
11:34:11 AM: β― Loading plugins
11:34:11 AM: - @netlify/plugin-nextjs@3.0.3 from netlify.toml and package.json
11:34:11 AM: β
11:34:11 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:34:11 AM: 1. onPreBuild command from @netlify/plugin-nextjs
11:34:11 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:34:11 AM: β
11:34:12 AM: info - Using webpack 5. Reason: future.webpack5 option enabled webpack5 | Next.js
11:34:12 AM: β
11:34:12 AM: (@netlify/plugin-nextjs onPreBuild completed in 988ms)
11:34:12 AM: β
11:34:12 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:34:12 AM: 2. build.command from netlify.toml
11:34:12 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:34:12 AM: β
11:34:12 AM: $ npm run build
11:34:13 AM: > nextweather@0.1.0 build /opt/build/repo
11:34:13 AM: > next build
11:34:14 AM: info - Using webpack 5. Reason: future.webpack5 option enabled webpack5 | Next.js
11:34:15 AM: warn - No build cache found. Please configure build caching for faster rebuilds. Read more: no-cache | Next.js
11:34:15 AM: info - Checking validity of typesβ¦
11:34:18 AM: info - Creating an optimized production buildβ¦
11:34:32 AM: [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Canβt resolve βfseventsβ in β/opt/build/repo/node_modules/chokidarβ while resolving βfseventsβ in /opt/build/repo/node_modules/chokidar to a directory
11:34:35 AM: (node:1394) [DEP_WEBPACK_CHUNK_HAS_ENTRY_MODULE] DeprecationWarning: Chunk.hasEntryModule: Use new ChunkGraph API
11:34:36 AM: [webpack.cache.PackFileCacheStrategy] Caching failed for pack: Error: Canβt resolve βfseventsβ in β/opt/build/repo/node_modules/chokidarβ while resolving βfseventsβ in /opt/build/repo/node_modules/chokidar to a directory
11:34:36 AM: warn - Compiled with warnings
11:34:36 AM: ./node_modules/keyv/src/index.js
11:34:36 AM: Critical dependency: the request of a dependency is an expression
11:34:36 AM: ./node_modules/next/dist/next-server/server/load-components.js
11:34:36 AM: Critical dependency: the request of a dependency is an expression
11:34:36 AM: ./node_modules/next/dist/next-server/server/load-components.js
11:34:36 AM: Critical dependency: the request of a dependency is an expression
11:34:36 AM: ./node_modules/next/dist/next-server/server/require.js
11:34:36 AM: Critical dependency: the request of a dependency is an expression
11:34:36 AM: ./node_modules/next/dist/next-server/server/require.js
11:34:36 AM: Critical dependency: the request of a dependency is an expression
11:34:36 AM: ./node_modules/next/dist/next-server/server/require.js
11:34:36 AM: Critical dependency: the request of a dependency is an expression
11:34:36 AM: info - Collecting page dataβ¦
11:34:37 AM: info - Generating static pages (0/3)
11:34:38 AM: info - Generating static pages (3/3)
11:34:38 AM: info - Finalizing page optimizationβ¦
11:34:38 AM: Page Size First Load JS
11:34:38 AM: β β / 3.44 kB 67.5 kB
11:34:38 AM: β β css/9a0e57cc520cbbcc7d30.css 669 B
11:34:38 AM: β /_app 0 B 64.1 kB
11:34:38 AM: β β /404 3.44 kB 67.5 kB
11:34:38 AM: β Ξ» /api/csv 0 B 64.1 kB
11:34:38 AM: β Ξ» /api/observations 0 B 64.1 kB
11:34:38 AM: β Ξ» /api/tsv 0 B 64.1 kB
11:34:38 AM: β Ξ» /api/util/convert 0 B 64.1 kB
11:34:38 AM: + First Load JS shared by all 64.1 kB
11:34:38 AM: β chunks/597.b0deca.js 13.3 kB
11:34:38 AM: β chunks/778.7db2cf.js 7.05 kB
11:34:38 AM: β chunks/framework.dad012.js 42 kB
11:34:38 AM: β chunks/main.9ca82e.js 151 B
11:34:38 AM: β chunks/pages/_app.65838e.js 564 B
11:34:38 AM: β chunks/webpack.37bb74.js 993 B
11:34:38 AM: β css/9555fbe4118c83c59ab9.css 203 B
11:34:38 AM: Ξ» (Lambda) server-side renders at runtime (uses getInitialProps or getServerSideProps)
11:34:38 AM: β (Static) automatically rendered as static HTML (uses no initial props)
11:34:38 AM: β (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
11:34:38 AM: (ISR) incremental static regeneration (uses revalidate in getStaticProps)
11:34:38 AM: β
11:34:38 AM: (build.command completed in 25.6s)
11:34:38 AM: β
11:34:38 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:34:38 AM: 3. onBuild command from @netlify/plugin-nextjs
11:34:38 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:34:38 AM: β
11:34:38 AM: ** Running Next on Netlify package **
11:34:38 AM: Next on Netlify
11:34:38 AM: Copying public/ folder to Users/ivan/dev/nextweather/out_publish
11:34:39 AM: info - Using webpack 5. Reason: future.webpack5 option enabled webpack5 | Next.js
11:34:39 AM: Copying static NextJS assets to Users/ivan/dev/nextweather/out_publish
11:34:39 AM: Setting up API endpoints as Netlify Functions in pages/api
11:34:39 AM: Setting up pages with getInitialProps as Netlify Functions in pages/api
11:34:39 AM: Setting up pages with getServerSideProps as Netlify Functions in pages/api
11:34:39 AM: Copying pre-rendered pages with getStaticProps and JSON data to Users/ivan/dev/nextweather/out_publish
11:34:39 AM: Setting up pages with getStaticProps and fallback: true as Netlify Functions in pages/api
11:34:39 AM: Setting up pages with getStaticProps and revalidation interval as Netlify Functions in pages/api
11:34:39 AM: Copying pre-rendered pages without props to Users/ivan/dev/nextweather/out_publish
11:34:39 AM: Setting up redirects
11:34:39 AM: Setting up headers
11:34:39 AM: Success! All done!
11:34:39 AM: β
11:34:39 AM: (@netlify/plugin-nextjs onBuild completed in 757ms)
11:34:39 AM: β
11:34:39 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:34:39 AM: 4. Functions bundling
11:34:39 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:34:39 AM: β
11:34:39 AM: Packaging Functions from pages/api directory:
11:34:39 AM: - csv.ts
11:34:39 AM: - next_image.js
11:34:39 AM: - observations.js
11:34:39 AM: - tsv.js
11:34:39 AM: - next_api_csv/next_api_csv.js
11:34:39 AM: - next_api_observations/next_api_observations.js
11:34:39 AM: - next_api_tsv/next_api_tsv.js
11:34:39 AM: - next_api_util_convert/next_api_util_convert.js
11:34:39 AM: β
11:34:39 AM: > node_modules/got/dist/source/core/utils/get-buffer.js:7:8: error: Transforming for-await loops to the configured target environment (βes2017β) is not supported yet
11:34:39 AM: 7 β for await (const chunk of stream) {
11:34:39 AM: β΅ ~~~~~
11:34:39 AM: > node_modules/got/dist/source/create.js:157:26: error: Transforming async generator functions to the configured target environment (βes2017β) is not supported yet
11:34:39 AM: 157 β const paginateEach = (async function* (url, options) {
11:34:39 AM: β΅ ~~~~~
11:34:39 AM: > node_modules/got/dist/source/create.js:213:12: error: Transforming for-await loops to the configured target environment (βes2017β) is not supported yet
11:34:39 AM: 213 β for await (const item of paginateEach(url, options)) {
11:34:39 AM: β΅ ~~~~~
11:34:39 AM: > pages/api/csv.ts:3:36: error: Could not resolve β./util/convertβ
11:34:39 AM: 3 β import { metersPerSecondToMph} from β./util/convertβ;
11:34:39 AM: β΅ ~~~~~~~~~~~~~~~~
11:34:39 AM: > node_modules/got/dist/source/core/utils/get-buffer.js:7:8: error: Transforming for-await loops to the configured target environment (βes2017β) is not supported yet
11:34:39 AM: 7 β for await (const chunk of stream) {
11:34:39 AM: β΅ ~~~~~
11:34:39 AM: > node_modules/got/dist/source/create.js:157:26: error: Transforming async generator functions to the configured target environment (βes2017β) is not supported yet
11:34:39 AM: 157 β const paginateEach = (async function* (url, options) {
11:34:39 AM: β΅ ~~~~~
11:34:39 AM: > node_modules/got/dist/source/create.js:213:12: error: Transforming for-await loops to the configured target environment (βes2017β) is not supported yet
11:34:39 AM: 213 β for await (const item of paginateEach(url, options)) {
11:34:39 AM: β΅ ~~~~~
11:34:39 AM: > node_modules/got/dist/source/create.js:157:26: error: Transforming async generator functions to the configured target environment (βes2017β) is not supported yet
11:34:39 AM: 157 β const paginateEach = (async function* (url, options) {
11:34:39 AM: β΅ ~~~~~
11:34:39 AM: > node_modules/got/dist/source/create.js:213:12: error: Transforming for-await loops to the configured target environment (βes2017β) is not supported yet
11:34:39 AM: 213 β for await (const item of paginateEach(url, options)) {
11:34:39 AM: β΅ ~~~~~
11:34:39 AM: > node_modules/keyv/src/index.js:18:14: warning: This call to βrequireβ will not be bundled because the argument is not a string literal (surround with a try/catch to silence this warning)
11:34:39 AM: 18 β return new (require(adapters[adapter]))(opts);
11:34:39 AM: β΅ ~~~~~~~
11:34:39 AM: > node_modules/got/dist/source/core/utils/get-buffer.js:7:8: error: Transforming for-await loops to the configured target environment (βes2017β) is not supported yet
11:34:39 AM: 7 β for await (const chunk of stream) {
11:34:39 AM: β΅ ~~~~~
11:34:39 AM: > node_modules/keyv/src/index.js:18:14: warning: This call to βrequireβ will not be bundled because the argument is not a string literal (surround with a try/catch to silence this warning)
11:34:39 AM: 18 β return new (require(adapters[adapter]))(opts);
11:34:39 AM: β΅ ~~~~~~~
11:34:39 AM: > node_modules/keyv/src/index.js:18:14: warning: This call to βrequireβ will not be bundled because the argument is not a string literal (surround with a try/catch to silence this warning)
11:34:39 AM: 18 β return new (require(adapters[adapter]))(opts);
11:34:39 AM: β΅ ~~~~~~~
11:34:39 AM: > pages/api/next_api_csv/nextPage/index.js:12072:8: error: Transforming for-await loops to the configured target environment (βes2017β) is not supported yet
11:34:39 AM: 12072 β for await (const chunk of stream) {
11:34:39 AM: β΅ ~~~~~
11:34:39 AM: > pages/api/next_api_csv/nextPage/index.js:12588:26: error: Transforming async generator functions to the configured target environment (βes2017β) is not supported yet
11:34:39 AM: 12588 β const paginateEach = (async function* (url, options) {
11:34:39 AM: β΅ ~~~~~
11:34:39 AM: > pages/api/next_api_csv/nextPage/index.js:12644:12: error: Transforming for-await loops to the configured target environment (βes2017β) is not supported yet
11:34:39 AM: 12644 β for await (const item of paginateEach(url, options)) {
11:34:39 AM: β΅ ~~~~~
11:34:42 AM: β
11:34:42 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:34:42 AM: Dependencies installation error
11:34:42 AM: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
11:34:42 AM: β
11:34:42 AM: Error message
11:34:42 AM: A Netlify Function failed to require one of its dependencies.
11:34:42 AM: Please make sure it is present in the siteβs top-level βpackage.jsonβ.β
11:34:42 AM: Build failed with 4 errors:
11:34:42 AM: node_modules/got/dist/source/core/utils/get-buffer.js:7:8: error: Transforming for-await loops to the configured target environment (βes2017β) is not supported yet
11:34:42 AM: node_modules/got/dist/source/create.js:157:26: error: Transforming async generator functions to the configured target environment (βes2017β) is not supported yet
11:34:42 AM: node_modules/got/dist/source/create.js:213:12: error: Transforming for-await loops to the configured target environment (βes2017β) is not supported yet
11:34:42 AM: pages/api/csv.ts:3:36: error: Could not resolve β./util/convertβ
11:34:42 AM: β
11:34:42 AM: Resolved config
11:34:42 AM: build:
11:34:42 AM: command: npm run build
11:34:42 AM: commandOrigin: config
11:34:42 AM: publish: /opt/build/repo/Users/ivan/dev/nextweather/out_publish
11:34:42 AM: functions:
11:34:42 AM: β*β:
11:34:42 AM: node_bundler: esbuild
11:34:42 AM: functionsDirectory: /opt/build/repo/pages/api
11:34:42 AM: plugins:
11:34:42 AM: - inputs: {}
11:34:42 AM: origin: config
11:34:42 AM: package: β@netlify/plugin-nextjsβ
11:34:43 AM: Caching artifacts
11:34:43 AM: Started saving node modules
11:34:43 AM: Finished saving node modules
11:34:43 AM: Started saving build plugins
11:34:43 AM: Finished saving build plugins
11:34:43 AM: Started saving pip cache
11:34:43 AM: Finished saving pip cache
11:34:43 AM: Started saving emacs cask dependencies
11:34:43 AM: Finished saving emacs cask dependencies
11:34:43 AM: Started saving maven dependencies
11:34:43 AM: Finished saving maven dependencies
11:34:43 AM: Started saving boot dependencies
11:34:43 AM: Finished saving boot dependencies
11:34:43 AM: Started saving rust rustup cache
11:34:43 AM: Finished saving rust rustup cache
11:34:43 AM: Started saving go dependencies
11:34:43 AM: Finished saving go dependencies
11:34:43 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:34:43 AM: Failing build: Failed to build site
11:34:43 AM: Failed during stage βbuilding siteβ: Build script returned non-zero exit code: 2
11:34:43 AM: Finished processing build request in 1m44.842282737s