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

Unable to Run in Dev #149

Closed
willpuckett opened this issue Aug 31, 2024 · 7 comments
Closed

Unable to Run in Dev #149

willpuckett opened this issue Aug 31, 2024 · 7 comments

Comments

@willpuckett
Copy link
Contributor

It seems that the url being returned by callsites()[1].getFileName() in blog.tsx:109 doesn't include the 'file://', and is preventing fromFileUrl from parsing it correctly...

deno task start
Task start deno run --allow-net --allow-read --allow-env --watch main.tsx --dev
Watcher Process started.
⚠️  Import assertions are deprecated. Use `with` keyword, instead of 'assert' keyword.

import emojis from "./all.json" assert { type: "json" };

  at https://deno.land/x/[email protected]/emoji.ts:2:1

TypeError: Invalid URL: '/Users/puck/Public/smote/main.tsx'
    at getSerialization (ext:deno_url/00_url.js:98:11)
    at new URL (ext:deno_url/00_url.js:405:27)
    at fromFileUrl (https://deno.land/[email protected]/path/posix.ts:460:36)
    at configureBlog (https://raw.githubusercontent.com/denoland/deno_blog/main/blog.tsx:176:22)
    at blog (https://raw.githubusercontent.com/denoland/deno_blog/main/blog.tsx:110:27)
    at file:///Users/puck/Public/smote/main.tsx:11:1
error: Uncaught (in promise) Error: Cannot run blog from a remote URL.
    throw new Error("Cannot run blog from a remote URL.");
          ^
    at configureBlog (https://raw.githubusercontent.com/denoland/deno_blog/main/blog.tsx:180:11)
    at blog (https://raw.githubusercontent.com/denoland/deno_blog/main/blog.tsx:110:27)
    at file:///Users/puck/Public/smote/main.tsx:11:1
Watcher Process failed. Restarting on file change...
^C
@willpuckett
Copy link
Contributor Author

denoland/deno#24727

@willpuckett
Copy link
Contributor Author

willpuckett commented Sep 4, 2024

I made a few changes in #150 that seem to work on my machine and Deno Deploy, although I'm not sure they're fully inclusive of handling paths on all platforms...

@san-ghun
Copy link

san-ghun commented Sep 5, 2024

I made a few changes in #150 that seem to work on my machine and Deno Deploy, although I'm not sure they're fully inclusive of handling paths on all platforms...

Hey @willpuckett
I have faced the same issue. I am unable to run it on local dev. With your change on #150 fixed mine to be able to run in local dev. Thanks!

@tdharris
Copy link

I also ran into this issue. I'm hoping this will be considered for fix in main. Otherwise, the latest compatible version of Deno is 1.45.3

@tdharris
Copy link

tdharris commented Oct 4, 2024

This also started failing in PROD in Deno Deploy. The same fix appears to work. Likely depends on the version of Deno in the runtime. If it's newer than 1.45.3 then it will fail and requires that file:// prefix you have from #150.

@ryoo14
Copy link

ryoo14 commented Oct 6, 2024

I am also encountering the same issue.
I am using macOS, and the same issue occurs not only in DEV but also when IS_DEV is false.

@aryan02420
Copy link

Deno Deploy has rolled back the changes that caused this error. For local development, I am using v1.44, which is working perfectly.

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

No branches or pull requests

5 participants