Skip to content

build failed. 'Could not find sw.js' #1824

Description

@brightmann

01:39:13.354 Running build in Washington, D.C., USA (East) – iad1
01:39:13.355 Build machine configuration: 2 cores, 8 GB
01:39:13.489 Cloning github.com/brightmann/ppn (Branch: master, Commit: 4170cbb)
01:39:13.490 Previous build caches not available.
01:39:13.969 Cloning completed: 480.000ms
01:39:14.363 Running "vercel build"
01:39:14.391 Vercel CLI 54.19.0
01:39:15.258 Running "install" command: yarn...
01:39:15.940 yarn install v1.22.19
01:39:16.074 [1/4] Resolving packages...
01:39:16.775 [2/4] Fetching packages...
01:39:37.398 [3/4] Linking dependencies...
01:39:37.401 warning " > markdown-to-jsx@6.11.4" has unmet peer dependency "react@>= 0.14.0".
01:39:37.403 warning "eslint-config-synacor > eslint-plugin-react > eslint-plugin-eslint-plugin@2.1.0" has incorrect peer dependency "eslint@>=5.0.0".
01:39:37.403 warning " > jest-preset-preact@1.0.0" has incorrect peer dependency "jest@24.x".
01:39:37.412 warning " > preact-render-spy@1.3.0" has incorrect peer dependency "preact@^8.1.0".
01:39:37.414 warning " > react-syntax-highlighter@12.2.1" has unmet peer dependency "react@>= 0.14.0".
01:39:48.336 [4/4] Building fresh packages...
01:39:50.512 Done in 34.89s.
01:39:51.280 yarn run v1.22.19
01:39:51.327 $ preact build --prerenderUrls ./prerender-urls.js
01:39:53.684 (node:341) [DEP0176] DeprecationWarning: fs.F_OK is deprecated, use fs.constants.F_OK instead
01:39:53.685 (Use node --trace-deprecation ... to show where the warning was created)
01:39:53.748 ℹ INFO Fetching URLs from ./prerender-urls.js
01:39:53.749 ℹ INFO Fetched URLs from ./prerender-urls.js
01:39:53.764 ⚠ WARN Could not find sw.js in /vercel/path0/src. Using the default service worker.
01:39:54.161 ✖ ERROR TypeError: Function.prototype.apply was called on undefined, which is a undefined and not a function
01:39:54.168 at $o (/vercel/path0/node_modules/esm/esm.js:1:224377)
01:39:54.168 at wu (/vercel/path0/node_modules/esm/esm.js:1:227324)
01:39:54.169 at Eu (/vercel/path0/node_modules/esm/esm.js:1:227999)
01:39:54.169 at Module. (/vercel/path0/node_modules/esm/esm.js:1:295976)
01:39:54.169 at n (/vercel/path0/node_modules/esm/esm.js:1:279589)
01:39:54.169 at module.exports (/vercel/path0/node_modules/preact-cli/lib/lib/webpack/transform-config.js:110:34)
01:39:54.169 at async prodBuild (/vercel/path0/node_modules/preact-cli/lib/lib/webpack/run-webpack.js:87:2)
01:39:54.170 at async module.exports (/vercel/path0/node_modules/preact-cli/lib/commands/build.js:30:14)
01:39:54.230 error Command failed with exit code 1.
01:39:54.231 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
01:39:54.323 Error: Command "yarn build" exited with 1

how to fix it?
tks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions