Skip to content
New issue

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

Build error with prerendering for "mailto:", "tel:" and missing parent URL on a parent-child page #2913

Closed
tonprince opened this issue Nov 25, 2021 · 1 comment · May be fixed by naiba4/kit#1

Comments

@tonprince
Copy link

tonprince commented Nov 25, 2021

Describe the bug

After commit of 'f12bbcc686829243f111db1b463d4a261fb67c23' I got several build errors in Sveltekit with prerendering enabled:

  1. Anchors with href set to tel: and mailto: will fail with an error during prerendering (page not found)
  2. Having a child URL, where the parent URL does not exists:
  • Existing URL: /Transfers/From-Trat/To-Koh-Kood/By-Boonsiri-High-Speed-Ferries/High-Season
  • Parent URL does not exists: /Transfers/From-Trat/To-Koh-Kood/By-Boonsiri-High-Speed-Ferries
    Even the parent URL is not referenced anywhere in other HTML files, Sveltekit tries to prerender the parent URL.

Reproduction

  • Add anchor with href="mailto:" or href="tel:".
  • Try to add 2 pages with parent-child structure where parent does not exists.

Logs

404 /Transfers/From-Trat/To-Koh-Kood/By-Boonsiri-High-Speed-Ferries (linked from /Transfers/From-Trat/To-Koh-Kood/By-Boonsiri-High-Speed-Ferries/High-Season)
Error: 404 /Transfers/From-Trat/To-Koh-Kood/By-Boonsiri-High-Speed-Ferries (linked from /Transfers/From-Trat/To-Koh-Kood/By-Boonsiri-High-Speed-Ferries/High-Season)
    at file:///Users/tonprincepro/Dropbox/Tripstore/Website/workspace/com.tripstorekrabi/next/node_modules/@sveltejs/kit/dist/chunks/index4.js:86:11
    at visit (file:///Users/tonprincepro/Dropbox/Tripstore/Website/workspace/com.tripstorekrabi/next/node_modules/@sveltejs/kit/dist/chunks/index4.js:222:5)
    at async visit (file:///Users/tonprincepro/Dropbox/Tripstore/Website/workspace/com.tripstorekrabi/next/node_modules/@sveltejs/kit/dist/chunks/index4.js:293:6)
    at async visit (file:///Users/tonprincepro/Dropbox/Tripstore/Website/workspace/com.tripstorekrabi/next/node_modules/@sveltejs/kit/dist/chunks/index4.js:293:6)
    at async visit (file:///Users/tonprincepro/Dropbox/Tripstore/Website/workspace/com.tripstorekrabi/next/node_modules/@sveltejs/kit/dist/chunks/index4.js:293:6)
    at async visit (file:///Users/tonprincepro/Dropbox/Tripstore/Website/workspace/com.tripstorekrabi/next/node_modules/@sveltejs/kit/dist/chunks/index4.js:293:6)
    at async visit (file:///Users/tonprincepro/Dropbox/Tripstore/Website/workspace/com.tripstorekrabi/next/node_modules/@sveltejs/kit/dist/chunks/index4.js:293:6)
    at async visit (file:///Users/tonprincepro/Dropbox/Tripstore/Website/workspace/com.tripstorekrabi/next/node_modules/@sveltejs/kit/dist/chunks/index4.js:293:6)
    at async visit (file:///Users/tonprincepro/Dropbox/Tripstore/Website/workspace/com.tripstorekrabi/next/node_modules/@sveltejs/kit/dist/chunks/index4.js:293:6)
    at async visit (file:///Users/tonprincepro/Dropbox/Tripstore/Website/workspace/com.tripstorekrabi/next/node_modules/@sveltejs/kit/dist/chunks/index4.js:293:6)

System Info

System:
    OS: macOS 12.0.1
    CPU: (16) x64 Intel(R) Xeon(R) W-2140B CPU @ 3.20GHz
    Memory: 7.41 GB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.0 - /usr/local/bin/node
    Yarn: 1.22.15 - ~/.yarn/bin/yarn
    npm: 6.14.15 - /usr/local/bin/npm
  Browsers:
    Chrome: 96.0.4664.55
    Edge: 96.0.1054.34
    Firefox: 94.0.2
    Safari: 15.1
  npmPackages:
    @googlemaps/js-api-loader: ^1.12.10 => 1.12.10 
    @sveltejs/adapter-vercel: next => 1.0.0-next.31 
    @sveltejs/kit: next => 1.0.0-next.200 
    @types/leaflet.fullscreen: ^1.6.1 => 1.6.1 
    bulma: ^0.9.3 => 0.9.3 
    bulma-toast: ^2.4.1 => 2.4.1 
    cookie: ^0.4.1 => 0.4.1 
    dayjs: ^1.10.7 => 1.10.7 
    ejs: ^3.1.6 => 3.1.6 
    fast-glob: ^3.2.7 => 3.2.7 
    firebase-admin: ^10.0.0 => 10.0.0 
    form-data: ^4.0.0 => 4.0.0 
    isbot: ^3.3.4 => 3.3.4 
    juice: ^8.0.0 => 8.0.0 
    leaflet: ^1.7.1 => 1.7.1 
    leaflet-routing-machine: ^3.2.12 => 3.2.12 
    leaflet.awesome-markers: ^2.0.5 => 2.0.5 
    leaflet.fullscreen: ^2.1.0 => 2.1.0 
    leaflet.gridlayer.googlemutant: ^0.13.4 => 0.13.4 
    lodash.isequal: ^4.5.0 => 4.5.0 
    mailgun.js: ^4.0.0 => 4.0.0 
    nanoid: ^3.1.30 => 3.1.30 
    node-cache: ^5.1.2 => 5.1.2 
    pusher: ^5.0.0 => 5.0.0 
    pusher-js: ^7.0.3 => 7.0.3 
    recaptcha-v3: ^1.10.0 => 1.10.0 
    sass: ^1.43.5 => 1.43.5 
    screenfull: ^6.0.0 => 6.0.0 
    shared: file:../shared => 1.1.0 
    svelte: ^3.44.2 => 3.44.2 
    svelte-calendar: ^2.0.4 => 2.0.4 
    svelte-preprocess: ^4.9.8 => 4.9.8 
    swiper: ^7.3.1 => 7.3.1 
    xmlbuilder2: ^3.0.2 => 3.0.2

Severity

blocking an upgrade

Additional Information

No response

@tonprince tonprince changed the title Build error with prerendering for mailto and Build error with prerendering for "mailto:" and tel: Nov 25, 2021
@tonprince tonprince changed the title Build error with prerendering for "mailto:" and tel: Build error with prerendering for "mailto:", "tel:" and missing parent-child URLs Nov 25, 2021
@tonprince tonprince changed the title Build error with prerendering for "mailto:", "tel:" and missing parent-child URLs Build error with prerendering for "mailto:", "tel:" and missing parent URL on a parent-child page Nov 25, 2021
@antony
Copy link
Member

antony commented Nov 25, 2021

Duplicate of #2909

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants