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

JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. || pragmaFrag cannot be set when runtime is automatic #2405

Open
j-Cis opened this issue Apr 14, 2024 · 2 comments

Comments

@j-Cis
Copy link

j-Cis commented Apr 14, 2024

I have a problem, VSCode highlights all preact/html elements in red as an error.
JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists.

err1-Snipaste_2024-04-14_08-58-53

I noticed that if I add these 3 lines to each element, the problem of highlighting the error disappears, but then this creates another problem, this time with compilation.

/** @jsx h */
/** @jsxFrag Fragment */
import { h, Fragment } from "preact";

err2-Snipaste_2024-04-14_09-05-20

Watcher File change detected! Restarting!
error: Uncaught (in promise) TypeError: pragma cannot be set when runtime is automatic at file:///A:/_CODE/SVG_DENO/svg-chart-family/routes/index.tsx:1:1

pragmaFrag cannot be set when runtime is automatic at file:///A:/_CODE/SVG_DENO/svg-chart-family/routes/index.tsx:2:1
  const manifest = (await import(toFileUrl(join(dir, "fresh.gen.ts")).href))
                    ^
    at async dev (https://deno.land/x/fresh@1.6.8/src/dev/dev_command.ts:38:21)
    at async file:///A:/_CODE/SVG_DENO/svg-chart-family/dev.ts:8:1
Watcher Process failed. Restarting on file change...

This problem was also noticed in deno: https://github.com/denoland/deno/issues/23339

@j-Cis j-Cis changed the title JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. || pragmaFrag cannot be set when runtime is automatic Apr 14, 2024
@nayeemrmn
Copy link

This is fixed now, try deno upgrade --canary.

@nickguimond
Copy link

This was a problem for me because I had all my repositories in a shared workspace. As soon as I opened my Deno fresh app in a single vscode workspace the problem went away.

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

3 participants