We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating client-side pages with path match parameters fails on Windows because of invalid path characters (:):
:
Error: C:\Users\[redacted]\public\page-data\path\:param contains invalid WIN32 path characters.
gatsby-node.js
exports.createPages = async ({actions}) => { const {createPage} = actions createPage({ path: '/path/:param', matchPath: '/path/:param', component: require.resolve('./src/templates/PageTemplate.js') }) }
src/templates/PageTemplate.js
import React from 'react' const PageTemplate = ({param}) => ( <h1>{param}</h1> ) export default PageTemplate
gatsby develop
http://localhost:8000/path/1
1
(refer to issue description)
System: System: OS: Windows 10 10.0.19041 Binaries: Node: 14.17.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD npmPackages: gatsby: ^3.6.2 => 3.6.2 npmGlobalPackages: gatsby-cli: 3.6.0
The text was updated successfully, but these errors were encountered:
Hmm does this same bug occur if you make the route like src/pages/path/[id].js ?
src/pages/path/[id].js
https://www.gatsbyjs.com/docs/reference/routing/file-system-route-api/#creating-client-only-routes
Sorry, something went wrong.
Hmm does this same bug occur if you make the route like src/pages/path/[id].js ? https://www.gatsbyjs.com/docs/reference/routing/file-system-route-api/#creating-client-only-routes
No, works perfectly, thank you @KyleAMathews!
:id
Ok good to know. The other way should work as well so we should fix it.
No branches or pull requests
Description
Creating client-side pages with path match parameters fails on Windows because of invalid path characters (
:
):Steps to reproduce:
gatsby-node.js
file:src/templates/PageTemplate.js
:gatsby develop
to build the project on a Windows machine.http://localhost:8000/path/1
(if the process hasn't failed yet).Expected result
http://localhost:8000/path/1
and see the provided parameter (1
)Actual result
(refer to issue description)
Environment
References
The text was updated successfully, but these errors were encountered: