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

Deno SSR with prerender=true complains about invalid URL scheme #6131

Closed
1 task done
andrioid opened this issue Feb 4, 2023 · 2 comments · Fixed by #6248
Closed
1 task done

Deno SSR with prerender=true complains about invalid URL scheme #6131

andrioid opened this issue Feb 4, 2023 · 2 comments · Fixed by #6248
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@andrioid
Copy link

andrioid commented Feb 4, 2023

What version of astro are you using?

2.0.6

Are you using an SSR adapter? If so, which one?

Deno

What package manager are you using?

pnpm

What operating system are you using?

Linux

Describe the Bug

Adding export const prerender = true to index.astro in the Deno example is enough to cause the error:

Steps:

  1. Check out the example repo
  2. Run: pnpm run build
  3. Observe the following...
 prerendering static routes 
 error   Only URLs with a scheme in: file, data are supported by the default ESM loader. Received protocol 'https:'
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data are supported by the default ESM loader. Received protocol 'https:'
    at new NodeError (node:internal/errors:372:5)
    at throwIfUnsupportedURLScheme (node:internal/modules/esm/resolve:1120:11)
    at defaultResolve (node:internal/modules/esm/resolve:1200:3)
    at ESMLoader.resolve (node:internal/modules/esm/loader:580:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40)
    at link (node:internal/modules/esm/module_job:78:36)
 ELIFECYCLE  Command failed with exit code 1.

I was attempting to migrate my Astro site to SSR. I have several things that I'd like to pre-render, such as my PDF CV and social-cards.

Link to Minimal Reproducible Example

https://github.com/andrioid/astro-deno-ssr-prerender-bug

Participation

  • I am willing to submit a pull request for this issue.
@andrioid andrioid changed the title Deno SSR does with prerender=true complains about invalid URL scheme Deno SSR with prerender=true complains about invalid URL scheme Feb 4, 2023
@matthewp matthewp added the - P4: important Violate documented behavior or significantly impacts performance (priority) label Feb 8, 2023
@JerryWu1234
Copy link
Contributor

mark

JerryWu1234 added a commit to JerryWu1234/astro that referenced this issue Feb 14, 2023
JerryWu1234 added a commit to JerryWu1234/astro that referenced this issue Feb 14, 2023
natemoo-re pushed a commit that referenced this issue Feb 16, 2023
* fix: #6131

* fix: delete

* update code

* fix: fix bug

* add some tests

* fix route error

* delete comment

* delete trash code

---------

Co-authored-by: wuls <linsheng.wu@beantechs.com>
matthewp added a commit that referenced this issue Feb 17, 2023
This reverts commit ef5cea4.
matthewp added a commit that referenced this issue Feb 17, 2023
* Revert "Deno fix #6131 (#6248)"

This reverts commit ef5cea4.

* Create gold-months-live.md
@natemoo-re
Copy link
Member

A fix for this was added, then reverted. The new fix is #6284 which should have some performance gains as well.

Going out in @astrojs/deno@4.0.2

liruifengv pushed a commit to liruifengv/astro that referenced this issue Feb 18, 2023
* Revert "Deno fix withastro#6131 (withastro#6248)"

This reverts commit ef5cea4.

* Create gold-months-live.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants