denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
96.47k stars 5.33k forks source link

`deno run -A npm:create-next-app -e hello-world` does not work #26383

Open arnauorriols opened 1 day ago

arnauorriols commented 1 day ago

Version: Deno 2.0.2 Error:

TypeError: Invalid URL: 'hello-world'
    at getSerialization (ext:deno_url/00_url.js:98:11)
    at new URL (ext:deno_url/00_url.js:405:27)
    at createApp (file:///Users/arnauorriols/Library/Caches/deno/npm/registry.npmjs.org/create-next-app/14.2.15/dist/index.js:30034:29)
    at run (file:///Users/arnauorriols/Library/Caches/deno/npm/registry.npmjs.org/create-next-app/14.2.15/dist/index.js:30528:27)
    at eventLoopTick (ext:core/01_core.js:175:7)
littledivy commented 1 day ago

Caused by use of non-standard error.code property:

https://github.com/vercel/next.js/blob/e8e1eb97183c68b3adfcec84984a0a040e008be7/packages/create-next-app/create-app.ts#L68-L71

    try {
      repoUrl = new URL(example)
    } catch (error: unknown) {
      const err = error as Error & { code: string | undefined }
      if (err.code !== 'ERR_INVALID_URL') {
        console.error(error)
        process.exit(1)
      }
    }
littledivy commented 1 day ago

Opened https://github.com/vercel/next.js/pull/71473