Vercel - TypeError: невозможно прочитать свойство 'system' из undefined

Похоже, моя сборка работает нормально. (И строить нормально локально).

Но я получаю эту ошибку при развертывании на Vercel.

08:04:54.329    [4/4] Building fresh packages...
08:04:56.738    success Saved lockfile.
08:04:56.742    Done in 39.69s.
08:04:56.778    Detected Next.js version: 10.0.3
08:04:56.779    Running "yarn run build"
08:04:57.063    yarn run v1.22.10
08:04:57.106    $ next build
08:04:57.789    Browserslist: caniuse-lite is outdated. Please run:
08:04:57.790    npx browserslist@latest --update-db
08:04:57.894    info  - Creating an optimized production build...
08:04:57.915    Attention: Next.js now collects completely anonymous telemetry regarding usage.
08:04:57.915    This information is used to shape Next.js' roadmap and prioritize features.
08:04:57.915    You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
08:04:57.915    https://nextjs.org/telemetry
08:06:05.124    info  - Compiled successfully
08:06:05.125    info  - Collecting page data...
08:06:07.309    > Build error occurred
08:06:07.312    TypeError: Cannot read property 'system' of undefined
08:06:07.312        at Object.get (/vercel/workpath0/node_modules/faker/lib/index.js:75:47)
08:06:07.312        at new System (/vercel/workpath0/node_modules/faker/lib/system.js:41:44)
08:06:07.312        at new Faker (/vercel/workpath0/node_modules/faker/lib/index.js:147:17)
08:06:07.312        at Object.<anonymous> (/vercel/workpath0/node_modules/faker/locale/en_US.js:2:13)
08:06:07.312        at Module._compile (internal/modules/cjs/loader.js:1063:30)
08:06:07.312        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
08:06:07.312        at Module.load (internal/modules/cjs/loader.js:928:32)
08:06:07.313        at Function.Module._load (internal/modules/cjs/loader.js:769:14)
08:06:07.317        at Module.require (internal/modules/cjs/loader.js:952:19)
08:06:07.317        at require (internal/modules/cjs/helpers.js:88:18) {
08:06:07.317      type: 'TypeError'
08:06:07.318    }
08:06:07.468    error Command failed with exit code 1.
08:06:07.469    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
08:06:07.486    Error: Command "yarn run build" exited with 1
08:06:10.181    Done with "package.json"

person Matt    schedule 26.03.2021    source источник
comment
Похоже на ошибку с библиотекой faker. Как вы его импортируете / используете?   -  person juliomalves    schedule 26.03.2021


Ответы (1)


Как отметил @juliomalves. Это была ошибка фейкера. Он работал нормально, но внезапно этого не произошло. В итоге я просто удалил его из своих пакетов.

yarn remove faker

И просто исключили его из проекта, поскольку он использовался только для демонстрационных материалов. Теперь все хорошо.

person Matt    schedule 26.03.2021