Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Pages Function naming causes failure - Cloudflare Developers
CD
Cloudflare Developers
•
3y ago
Ben Cox
Pages Function naming causes failure
hq
-simple
-astro
-spike
.pages
.dev
, Account ID
: 9f4ca528def6cd26be618a8891cc757e
, Deployment
: 0406c190
-2493
-4e13
-9e5d
-9cd4e3159036
Navigating to
https://0406c190.hq-simple-astro-spike.pages.dev/helloworld
, I get
:
Error 1101 Ray ID
: 7e8756453bbe1567
• 2023
-07
-18
0
2
:
3
6
:25 UTC
Worker threw exception
In the log
, I find
:
exceptions
:
[
{
"name
"
:
"TypeError
"
,
"message
"
:
"Unexpected MODIFIER at 27
, expected END
"
,
"timestamp
"
: 1689647785804
}
]
In addition to helloworld
.js
, I deployed a file at functions
/teacher
-directory
/
[
[td
-path
]
]
.ts
.
This caused the error
- not just in that particular function but every function
, including the most basic helloworld
.js example
!
This isn
't a build
-time or deploy
-time error
. After deployment the Functions tab shows
:
{
"routes
"
:
[
{
"routePath
"
:
"
/teacher
-directory
/
:td
-path
*
"
,
"mountPath
"
:
"
/teacher
-directory
"
,
"method
"
:
"
"
,
"module
"
:
[
"teacher
-directory
/
[
[td
-path
]
]
.
j
s
:onRequest
"
]
}
,
{
"routePath
"
:
"
/helloworld
"
,
"mountPath
"
:
"
/
"
,
"method
"
:
"
"
,
"module
"
:
[
"helloworld
.
j
s
:onRequest
"
]
}
]
,
"baseURL
"
:
"
/
"
}
It was perfectly happy to build and deploy this function
, but at runtime it broke
all
functions
.
No mention is in the docs
(here
:
https://developers.cloudflare.com/pages/platform/functions/routing/#multipath-segments
) about any filename specifications restricting dashes
. Note
, the directory may have a dash without issue
.
Is it possible to 1
. document these requirements
, and 2
. trigger a deploy
-time error for this
, rather than breaking the website
?
My personal website.
Welcome to my website
!
Routing · Cloudflare Pages docs
Functions utilize file
-based routing
. Your
/functions directory structure determines the designated routes that your Functions will run on
. You can
…
Cloudflare Developers
Join
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Was this page helpful?
Yes
No
Similar Threads
Similar Threads
Pages HMR + Function serving?
CD
Cloudflare Developers / pages-help
2y ago
Tree-shaking for Pages Function
CD
Cloudflare Developers / pages-help
2y ago
Internal error deploying Pages+Function
CD
Cloudflare Developers / pages-help
3y ago
Use `pg` in Pages Function?
CD
Cloudflare Developers / pages-help
3y ago