8000 Next.js components from `"next"` package are not importing types properly · Issue #25359 · denoland/deno · GitHub
[go: up one dir, main page]

Skip to content
Next.js components from "next" package are not importing types properly #25359
@richardvanbergen

Description

@richardvanbergen

I was excited to try out deno on Next.JS after hearing about it on the syntax podcast. It runs well but unfortunately I'm getting a couple of type errors when importing the next core components like next/link and next/image.

This only happens in the editor with the LSP so it might not be the right place to post it so let me know.

For good measure in the project that I found it in I tried copy and pasting the compiler options into deno.json. It had no effect.

JSX element type 'Link' does not have any construct or call signatures.deno-ts(2604)
'Link' cannot be used as a JSX component.
Its type 'typeof import("file:///Users/richardvanbergen/code/deno-nextjs-bug-example/node_modules/.deno/next@14.2.7/node_modules/next/link")' is not a valid JSX element type.deno-ts(2786)

JSX element type 'Image' does not have any construct or call signatures.deno-ts(2604)
'Image' cannot be used as a JSX component.
Its type 'typeof import("file:///Users/richardvanbergen/code/deno-nextjs-bug-example/node_modules/.deno/next@14.2.7/node_modules/next/image")' is not a valid JSX element type.deno-ts(2786)

Reproduction Steps:

  1. Download the repo from the link below
  2. Enable Deno from the menu command bar Deno: Enable
  3. Ensure Deno Future is checked in the user settings
  4. Just for good measure, add DENO_FUTURE=1 explicitly in the settings.
  5. Navigate to src/app/page.tsx.
  6. Behold! Errors!

Version: Deno 1.46.2
Reproduction repo: https://github.com/richardvanbergen/deno-nextjs-bug-example

Side note: I can deal with it but is there a way to enable wildcard import aliases?
Side side note: There's also an error importing the styles I personally don't care about that but if it's easy to answer then it might be worth documenting it.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working correctlynextjsIssue relating to Next.jsupstreamChanges in upstream are required to solve these issues

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0