question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Optimized Vue 3 JSX support in 2.0

See original GitHub issue
  • vite version: 2.0 bata1
  • Operating System: mac os
  • Node version: 14.15

When I change App.vue to App.tsx or App.jsx, the error “Uncaught ReferenceError: React is not defined” appears after running

Below is my code,this code is completely feasible in version 1.x

// src/App.tsx
export default () => {
  return <div>App</div>
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
yyx990803commented, Jan 4, 2021

b5b1496 added esbuild.jsxInject so you can specify auto-injected helper imports.

2reactions
yyx990803commented, Jan 5, 2021

Now provided via https://github.com/vitejs/vite/tree/main/packages/plugin-vue-jsx with HMR and Vue-dedicated transforms.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Render Functions & JSX | Vue.js
create-vue and Vue CLI both have options for scaffolding projects with pre-configured JSX support. If you are configuring JSX manually, please refer to...
Read more >
Template Syntax | Vue.js
Under the hood, Vue compiles the templates into highly-optimized JavaScript code ... write render functions instead of templates, with optional JSX support.
Read more >
Frequently Asked Questions - Vue.js
If you are starting a new project today, Vue 3 is the recommended choice. There are only a few reasons for you to...
Read more >
Single-File Components - Vue.js
IDE support with auto-completion and type-checking for template expressions; Out-of-the-box Hot-Module Replacement (HMR) support. SFC is a defining feature of ...
Read more >
Production Deployment - Vue.js
When deploying to production, we should drop all the unused, development-only code branches for smaller payload size and better performance. Without Build Tools ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found