'Error: `input` must not start with a slash when using `prefixUrl`

As soon as I update gatsby packages to the latest version, now version 4.10.1, or any version after 4.6, it directly gives me this error without any change in the code:

 ERROR 

`input` must not start with a slash when using `prefixUrl`

  Error: `input` must not start with a slash when using `prefixUrl`
  
  - index.js:484 normalizeArguments
    [guidedby-react]/[got]/dist/source/core/index.js:484:23
  
  - create.js:112 got
    [guidedby-react]/[got]/dist/source/create.js:112:39
  
  - create.js:221 Function.got.stream
    [guidedby-react]/[got]/dist/source/create.js:221:37
  
  - fetch-file.js:80 
    [guidedby-react]/[gatsby-core-utils]/dist/remote-file-utils/fetch-file.js:80:32
  
  - new Promise
  
  - fetch-file.js:45 requestRemoteNode
    [guidedby-react]/[gatsby-core-utils]/dist/remote-file-utils/fetch-file.js:45:10
  
  - fetch-remote-file.js:204 fetchFile
    [guidedby-react]/[gatsby-core-utils]/dist/fetch-remote-file.js:204:61
  
  - fetch-remote-file.js:102 fetchWorker
    [guidedby-react]/[gatsby-core-utils]/dist/fetch-remote-file.js:102:26
  

not finished run static queries - 0.605s

This is not the case working with Gatsby version 4.6.0, but I need to use Image CDN so I use need to update the packages. I think there is a change in the trailing slash on a package of 4.7, but no matter how many searches and tweaks I do, the error remains. What I've done so far:

  • Remove all external a href links
  • Put trailingSlash option in gatsby-config.js with different options (legacy, never, always). None of it works, and I have no problem working with the project on Gatsby 4.6, but I need to use Image CDN so I updated them. Any idea how to solve this problem. My repo is private, but as I said, the code develops and builds without any trouble working with 4.6, only update to higher versions create this problem.


Solution 1:[1]

I get this when I change the wordpress URL from local to azure. I am currently trying to figure it out to:

Tried: updating to latest gatsby

when I use local - build works

when I use azure - Error: input must not start with a slash when using prefixUrl

Will update when solved.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Michael Law