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

[v.1.0.0-rc.4] RangeError: Invalid count value #707

Closed
kazuki-hanai opened this issue Aug 15, 2020 · 7 comments
Closed

[v.1.0.0-rc.4] RangeError: Invalid count value #707

kazuki-hanai opened this issue Aug 15, 2020 · 7 comments

Comments

@kazuki-hanai
Copy link

kazuki-hanai commented Aug 15, 2020

Describe the bug

I'm using vite to build react app and I have a bug when execute vite build. This bug occurred at vite@1.0.0-rc.4, but not vite@1.0.0-rc.3 . And also, the bug didn't occur when I remove styled-components from the project.

Reproduction

https://github.com/wan-nyan-wan/vite-warning-bugs

System Info

  • vite@1.0.0-rc.4
  • OS: Ubuntu 18.04
  • Node: v14.5.0
  • Optional:
    • yarn: 1.22.4

Logs

Below is a build log.

$ yarn build      
yarn run v1.22.4
$ tsc --noEmit && vite build
vite v1.0.0-rc.4
⠧ Building for production...
[vite] warnings while transforming index.09068383.js with esbuild:
The following expression is not returned because of an automatically-inserted semicolon
[vite] error while transforming index.09068383.js with esbuild:
RangeError: Invalid count value
    at String.repeat (<anonymous>)
    at Object.generateCodeFrame (/home/sugerme/web/vite-bug/node_modules/@vue/shared/dist/shared.cjs.js:60:40)
    at printMessage (/home/sugerme/web/vite-bug/node_modules/vite/dist/node/esbuildService.js:108:52)
    at /home/sugerme/web/vite-bug/node_modules/vite/dist/node/esbuildService.js:63:44
    at Array.forEach (<anonymous>)
    at Object.exports.transform (/home/sugerme/web/vite-bug/node_modules/vite/dist/node/esbuildService.js:63:29)
    at async Chunk$1.render (/home/sugerme/web/vite-bug/node_modules/rollup/dist/shared/rollup.js:11227:20)
    at async /home/sugerme/web/vite-bug/node_modules/rollup/dist/shared/rollup.js:12201:40
    at async Promise.all (index 0)
[write] dist/asset/index.09068383.js 0.00kb, brotli: 0.00kb
[write] dist/index.html 0.30kb, brotli: 0.14kb
Build completed in 1.70s.

Done in 4.53s.
@evanw
Copy link

evanw commented Aug 15, 2020

This looks like two bugs: one for Vite about pretty-printing warnings with large line numbers, and one for Rollup for an incorrect code transformation. I filed the Rollup bug here: rollup/rollup#3729.

@lukastaegert
Copy link

Fixed on Rollup side.

@yyx990803
Copy link
Member

Fixed in vue-next as well (vuejs/core@b14f4a5), should be gone with next vue-next release.

@loristns
Copy link

Tried with vite v1.0.0-rc.4 and the newly released vue v3.0.0-rc.6 and the problem doesn't seem to be solved.

I confirm that the problem does not occur with vite v1.0.0-rc.3 though.

@quantuminformation
Copy link

I'm getting this too

@quantuminformation
Copy link

    "vite": "1.0.0-rc.3"

works fine

@stephanedemotte
Copy link

Same here, cannot build with swiper.js

[vite] warnings while transforming index.74698f84.js with esbuild:
Comparison with -0 using the === operator will also match 0
[vite] error while transforming index.74698f84.js with esbuild:
RangeError: Invalid count value

Downgrade to "vite": "1.0.0-rc.3"and boom i can build !

@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

7 participants