catch-all route in production
Unanswered
Horned oak gall posted this in #help-forum
Horned oak gallOP
This error is driving me nuts...
my directory structure looks like this:
pages/
[...category].tsx
-- product/
--- [product].tsx
when either navigating to eg. "site.com/clothing/shirts" or "site.com/product/123", the [...category] catch all route is rendered and ctx.params.category is giving me:
[
'_next',
'static',
'chunks',
'pages',
'product',
'[product]-d3ac513904213564.js'
]
and console.log is throwing "SyntaxError: Unexpected token '<' @ %5Bproduct%5D-d3ac513904213564.js:1"
HOWEVER this is ONLY happening in production (npm run start) mode on my cloudways server, in dev mode or locally in dev/production mode everything works fine.
my directory structure looks like this:
pages/
[...category].tsx
-- product/
--- [product].tsx
when either navigating to eg. "site.com/clothing/shirts" or "site.com/product/123", the [...category] catch all route is rendered and ctx.params.category is giving me:
[
'_next',
'static',
'chunks',
'pages',
'product',
'[product]-d3ac513904213564.js'
]
and console.log is throwing "SyntaxError: Unexpected token '<' @ %5Bproduct%5D-d3ac513904213564.js:1"
HOWEVER this is ONLY happening in production (npm run start) mode on my cloudways server, in dev mode or locally in dev/production mode everything works fine.