Skip to content

Static image does not render in production #37946

Answered by gh640
krrnk asked this question in Help
Discussion options

You must be logged in to vote

@krrnk

Thank you for your reply. I could reproduce the problem :)

I guess the --prefix-paths is not passed to gatsby xxx with the commands. We need to put -- before any options like:

npm run build -- --prefix-paths
npm run serve -- --prefix-paths

Any positional arguments are passed to the specified script. Use -- to pass --prefixed flags and options which would otherwise be parsed by npm.

―― npm-run-script | npm Docs

You can check how the target script is run in the stdout:

Without --:

npm run build --prefix-paths

> [email protected] build
> gatsby build

With --:

npm run build -- --prefix-paths

> [email protected] build
> gatsby build --prefix-paths

If you use --prefix-paths frequently, adding ded…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@gh640
Comment options

Answer selected by krrnk
@krrnk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants