gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.27k stars 10.31k forks source link

Error #95313: WebpackError: TypeError: path.startsWith is not a function #32958

Closed jurryabbas-dev closed 3 years ago

jurryabbas-dev commented 3 years ago

Preliminary Checks

Description

ERROR #95313

Building static HTML failed for path "/request-quote-thank-you/"

See our docs page for more info on this error: https://gatsby.dev/debug-html

62 | 63 | var isLocalLink = function isLocalLink(path) {

64 | return path && !path.startsWith("http://") && !path.startsWith("https://") && !path.startsWith("//"); | ^ 65 | }; 66 | 67 | function withAssetPrefix(path) {

WebpackError: TypeError: path.startsWith is not a function

not finished Generating image thumbnails - 27.020s

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! gatsby-starter-default@0.1.0 build: gatsby build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the gatsby-starter-default@0.1.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2021-08-30T07_56_18_861Z-debug.log root@gatsby:/home/projects/MortlockTimber# events.js:292 throw er; // Unhandled 'error' event ^

Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed at process.target.send (internal/child_process.js:705:16) at reportSuccess (/home/projects/MortlockTimber/node_modules/jest-worker/build/workers/processChild.js:83:11) at tryCatcher (/home/projects/MortlockTimber/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:729:18) at Promise._fulfill (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:673:18) at MappingPromiseArray.PromiseArray._resolve (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise_array.js:127:19) at MappingPromiseArray._promiseFulfilled (/home/projects/MortlockTimber/node_modules/bluebird/js/release/map.js:108:18) at Promise._settlePromise (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:609:26) at Promise._settlePromise0 (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:729:18) at _drainQueueStep (/home/projects/MortlockTimber/node_modules/bluebird/js/release/async.js:93:12) at _drainQueue (/home/projects/MortlockTimber/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/home/projects/MortlockTimber/node_modules/bluebird/js/release/async.js:102:5) Emitted 'error' event on process instance at: at internal/child_process.js:709:35 at processTicksAndRejections (internal/process/task_queues.js:75:11) { code: 'ERR_IPC_CHANNEL_CLOSED' }

Reproduction Link

https://github.com/jurryabbas-dev/mortlock-testcase

Steps to Reproduce

  1. Just setup gatsby, install node modules and run gatsby build, you'll reproduce the issue.

Expected Result

Build normally

Actual Result

ERROR #95313

Building static HTML failed for path "/request-quote-thank-you/"

See our docs page for more info on this error: https://gatsby.dev/debug-html

62 | 63 | var isLocalLink = function isLocalLink(path) {

64 | return path && !path.startsWith("http://") && !path.startsWith("https://") && !path.startsWith("//"); | ^ 65 | }; 66 | 67 | function withAssetPrefix(path) {

WebpackError: TypeError: path.startsWith is not a function

not finished Generating image thumbnails - 27.020s

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! gatsby-starter-default@0.1.0 build: gatsby build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the gatsby-starter-default@0.1.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2021-08-30T07_56_18_861Z-debug.log root@gatsby:/home/projects/MortlockTimber# events.js:292 throw er; // Unhandled 'error' event ^

Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed at process.target.send (internal/child_process.js:705:16) at reportSuccess (/home/projects/MortlockTimber/node_modules/jest-worker/build/workers/processChild.js:83:11) at tryCatcher (/home/projects/MortlockTimber/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:729:18) at Promise._fulfill (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:673:18) at MappingPromiseArray.PromiseArray._resolve (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise_array.js:127:19) at MappingPromiseArray._promiseFulfilled (/home/projects/MortlockTimber/node_modules/bluebird/js/release/map.js:108:18) at Promise._settlePromise (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:609:26) at Promise._settlePromise0 (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/home/projects/MortlockTimber/node_modules/bluebird/js/release/promise.js:729:18) at _drainQueueStep (/home/projects/MortlockTimber/node_modules/bluebird/js/release/async.js:93:12) at _drainQueue (/home/projects/MortlockTimber/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/home/projects/MortlockTimber/node_modules/bluebird/js/release/async.js:102:5) Emitted 'error' event on process instance at: at internal/child_process.js:709:35 at processTicksAndRejections (internal/process/task_queues.js:75:11) { code: 'ERR_IPC_CHANNEL_CLOSED' }

Environment

System:
    OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (1) x64 Intel Core Processor (Broadwell, no TSX, IBRS)
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 14.16.0 - ~/.nvm/versions/node/v14.16.0/bin/node
    npm: 6.14.11 - ~/.nvm/versions/node/v14.16.0/bin/npm
  npmPackages:
    gatsby: ^2.23.3 => 2.32.13
    gatsby-background-image: ^1.1.1 => 1.5.3
    gatsby-cli: ^2.12.99 => 2.19.3
    gatsby-image: ^2.4.7 => 2.11.0
    gatsby-plugin-alias-imports: ^1.0.5 => 1.0.5
    gatsby-plugin-canonical-urls: ^2.10.0 => 2.10.0
    gatsby-plugin-facebook-pixel: ^1.0.5 => 1.0.8
    gatsby-plugin-google-tagmanager: ^2.3.12 => 2.11.0
    gatsby-plugin-manifest: ^2.4.22 => 2.12.1
    gatsby-plugin-meta-redirect: ^1.1.1 => 1.1.1
    gatsby-plugin-netlify: ^2.10.0 => 2.11.1
    gatsby-plugin-offline: ^3.2.9 => 3.10.2
    gatsby-plugin-react-helmet: ^3.3.4 => 3.10.0
    gatsby-plugin-robots-txt: ^1.5.5 => 1.6.9
    gatsby-plugin-sass: ^2.3.9 => 2.8.0
    gatsby-plugin-scroll-indicator: ^1.0.1 => 1.0.1
    gatsby-plugin-scroll-reveal: ^0.0.7 => 0.0.7
    gatsby-plugin-sharp: ^2.6.11 => 2.14.4
    gatsby-plugin-sitemap: ^2.4.12 => 2.12.0
    gatsby-plugin-smoothscroll: ^1.2.0 => 1.2.0
    gatsby-plugin-sri: ^1.1.0 => 1.1.0
    gatsby-source-filesystem: ^2.3.11 => 2.11.1
    gatsby-source-wordpress: ^3.2.2 => 3.11.0
    gatsby-transformer-sharp: ^2.5.5 => 2.12.1

Config Flags

No response

LekoArts commented 3 years ago

Hi!

We're only actively supporting Gatsby v3 at the moment, so please give a reproduction with the latest version of all packages. Thanks!

github-actions[bot] commented 3 years ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

LekoArts commented 3 years ago

Hi!

Since we didn't receive an answer for 7 days or more about the ask of a reproduction I'm going to close this now, as we can't do much to help without a reproduction. If you are able to create a minimal reproduction for this then please do answer here or open a new issue with a reproduction. Thanks!

banana1988 commented 2 years ago

i found the reason, because you passed the whole an object into gatsby "to" attr in . Gatsby's "to" attr in . can only be a string.