You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
/routes/[...categories]/[item].html.svelte - this one works
neither /routes/[...categories].svelte or /routes/[...categories]/index.svelte works:
❯ yarn dev
yarn run v1.16.0
warning package.json: No license field
$ sapper dev
✗ client
src/routes/[...categories]/index.svelte
Module build failed (from ./node_modules/svelte-loader/index.js):
Error: TypeError: TypeError: Cannot read property 'toUpperCase' of undefined
✗ server
src/routes/[...categories]/index.svelte
Module build failed (from ./node_modules/svelte-loader/index.js):
Error: TypeError: TypeError: Cannot read property 'toUpperCase' of undefined
✔ service worker (168ms)
webpack:///./src/routes/%5B...categories%5D/index.svelte?:1
throw new Error("Module build failed (from ./node_modules/svelte-loader/index.js):\nError: TypeError: TypeError: Cannot read property 'toUpperCase' of undefined\n at preprocess.then.catch.err (/Users/semenov/tmp/my-app/node_modules/svelte-loader/index.js:180:12)");
^
Error: Module build failed (from ./node_modules/svelte-loader/index.js):
Error: TypeError: TypeError: Cannot read property 'toUpperCase' of undefined
at preprocess.then.catch.err (/Users/semenov/tmp/my-app/node_modules/svelte-loader/index.js:180:12)
at eval (webpack:///./src/routes/%5B...categories%5D/index.svelte?:1:7)
at Object../src/routes/[...categories]/index.svelte (/Users/semenov/tmp/my-app/__sapper__/dev/server/server.js:193:1)
at __webpack_require__ (/Users/semenov/tmp/my-app/__sapper__/dev/server/server.js:21:30)
at eval (webpack:///./src/node_modules/@sapper/internal/manifest-server.mjs?:12:89)
at Module../src/node_modules/@sapper/internal/manifest-server.mjs (/Users/semenov/tmp/my-app/__sapper__/dev/server/server.js:158:1)
at __webpack_require__ (/Users/semenov/tmp/my-app/__sapper__/dev/server/server.js:21:30)
at eval (webpack:///./src/node_modules/@sapper/server.mjs?:5:83)
at Module../src/node_modules/@sapper/server.mjs (/Users/semenov/tmp/my-app/__sapper__/dev/server/server.js:182:1)
at __webpack_require__ (/Users/semenov/tmp/my-app/__sapper__/dev/server/server.js:21:30)
at eval (webpack:///./src/server.js?:8:72)
> Server crashed
Tested on a brand new install of npx degit sveltejs/sapper-template#webpack my-app with only one file added at src/routes/[...categories]/index.svelte:
<h1>cat index</h1>
I traced this to be caused by Svelte's code:
functionget_name(filename){if(!filename)returnnull;constparts=filename.split(/[\/\\]/);if(parts.length>1&&/^index\.\w+/.test(parts[parts.length-1])){parts.pop();}constbase=parts.pop().replace(/\..+/,"")// <------ here [...categories] becomes [.replace(/[^a-zA-Z_$0-9]+/g,'_')// <------ here it becomes _.replace(/^_/,'')// <------ here it becomes empty.replace(/_$/,'').replace(/^(\d)/,'_$1');returnbase[0].toUpperCase()+base.slice(1);// here it crashes}
The text was updated successfully, but these errors were encountered:
Extracted from #706 as it's an unrelated issue.
/routes/[...categories]/[item].html.svelte
- this one works/routes/[...categories].svelte
or/routes/[...categories]/index.svelte
works:Tested on a brand new install of
npx degit sveltejs/sapper-template#webpack my-app
with only one file added atsrc/routes/[...categories]/index.svelte
:I traced this to be caused by Svelte's code:
The text was updated successfully, but these errors were encountered: