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 render function warning broken in production build #451

Closed
alexbakerdev opened this issue Jun 24, 2020 · 0 comments
Closed

JSX render function warning broken in production build #451

alexbakerdev opened this issue Jun 24, 2020 · 0 comments

Comments

@alexbakerdev
Copy link

alexbakerdev commented Jun 24, 2020

Describe the bug

Using vite build on the create vite-app (with and without updating vite version) with jsx produces a build that doesn't run, throwing error:
Uncaught TypeError: Cannot read property 'MODE' of undefined at index.fb79c190.js:1

This line is included in the dist output:

"development"===import.meta.env.MODE&&console.log("[vue tip] You are using an non-optimized version of Vue 3 JSX, which does not take advantage of Vue 3's runtime fast paths. An improved JSX transform will be provided at a later stage.")

Removing this line from assets/index.[hash].js allows the app to run as expected.

Reproduction

https://github.com/alexbakerdev/vite-vue-tsx-example/tree/master

1. yarn
2. yarn build
3. npx serve dist

open web page its blank, console logs an error

Uncaught TypeError: Cannot read property 'MODE' of undefined at index.fb79c190.js:1

System Info

  • required vite version: 1.0.0-beta.6
  • required Operating System: Ubunutu 20.04 - WSL 2.0
  • required Node version: 12.18.0
  • Optional:
    • yarn version: 1.22.4
    • Installed vue version: 3.0.0-beta.15
    • Installed @vue/compiler-sfc version: 3.0.0-beta.15

Logs (Optional if provided reproduction)

  1. Run vite or vite build with the --debug flag.
  2. Provide the error log here.
test on  master is 📦 v0.0.0 via ⬢ v12.18.0 
❯ yarn vite build --debug
yarn run v1.22.4
warning package.json: No license field
$ /home/alex/work/test/node_modules/.bin/vite build --debug
vite v1.0.0-beta.6
  vite:config env mode: production +0ms
  vite:config env: {} +1ms
Building for production...
  vite:build:resolve /favicon.ico --> /home/alex/work/test/public/favicon.ico +0ms
  vite:build:resolve /src/main.js --> /home/alex/work/test/src/main.js +1ms
  vite:build:asset /home/alex/work/test/public/favicon.ico -> /favicon.ico +0ms
[write] dist/_assets/index.fb79c190.js 42.68kb, brotli: 15.35kb
[write] dist/_assets/style.9e6be708.css 0.16kb, brotli: 0.10kb
[write] dist/index.html 0.38kb, brotli: 0.15kb
Build completed in 2.04s.

Done in 2.24s.
@alexbakerdev alexbakerdev changed the title JSX development warning broken in production build JSX render function warning broken in production build Jun 24, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant