deno icon indicating copy to clipboard operation
deno copied to clipboard

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

Open arnauorriols opened this issue 1 year ago • 3 comments

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)

arnauorriols avatar Oct 18 '24 10:10 arnauorriols

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 avatar Oct 18 '24 10:10 littledivy

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

littledivy avatar Oct 18 '24 11:10 littledivy

Opened vercel/next.js#71473

It's approved now, just need to fix the failed test

arnauorriols avatar Oct 24 '24 13:10 arnauorriols

Confirmed this is fixed with the latest version of npm:create-next-app. Closing

just need to fix the failed test

I'm not very sure where these tests are. Is that still relevant?

kt3k avatar Mar 27 '25 03:03 kt3k