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

Add vite.config.[ts|js] will cause vuedx-typecheck fail #133

Closed
stephen-yau opened this issue Dec 31, 2020 · 2 comments · Fixed by #143
Closed

Add vite.config.[ts|js] will cause vuedx-typecheck fail #133

stephen-yau opened this issue Dec 31, 2020 · 2 comments · Fixed by #143
Labels
bug Something isn't working

Comments

@stephen-yau
Copy link

Describe the bug

  • If you add vite.config.ts to the project, the vuedx-typecheck will fail during "yarn build"

  • Note that I created the issue on vite, but after digging a little bit more it appear to be vuedx-typecheck issue.

To Reproduce
Steps to reproduce the behavior:

yarn create vite-app vue3-test --template vue-ts
cd vue3-test
yarn install
yarn build

At this point everything work fine as expected.

Now create an empty vite.config.js (or .ts) run yarn build again and it will fail (log is too big to attach, but it output something like this)

dist/_assets/index.ae6b5f4b.js:2:13 - error 7006: Parameter 'e' implicitly has an 'any' type.
1 | function e(e,t){const n=Object.create(null),o=e.split(",");for(let e=0;e<o.length;e++)n[o[e]]=!0;return t?e=>!!n[e.toLowerCase()]:e=>!!n[e]}const ... (too long so removed)
2 | 

dist/_assets/index.ae6b5f4b.js:2:15 - error 7006: Parameter 't' implicitly has an 'any' type.
1 | function e(e,t){const n=Object.create(null),o=e.split(",");for(let e=0;e<o.length;e++)n[o[e]]=!0;return t?e=>!!n[e.toLowerCase()]:e=>!!n[e]}const ... (too long so removed)
2 | 

If I remove vuedx-typecheck in package.json build step, the build run fine, and obviously if I run "yarn run vuedx-typescript .", it will fail as well.

I also try to put something in vite.config.js like the example provided in README

export default {
  jsx: {
    factory: 'h',
    fragment: 'Fragment'
  }
}

It still fail.
Expected behavior
Build should not fail.

Info (please complete the following information):

  • vite version: 1.0.0-rc.13
  • Operating System: MacOS 11.1
  • Node version: 14.15.3
  • Optional:
  • yarn version: 1.22.10
  • vue version: 3.0.4
  • @vue/compiler-sfc version: 3.0.4
@stephen-yau stephen-yau added the bug Something isn't working label Dec 31, 2020
@stephen-yau
Copy link
Author

The original issue closed on vite and suggested I should test on vite 2.0 beta and reopen if this is still an issue. I just tested on vite 2.0.0.-beta.1 and I still got the same issue. However, this look like more of an issue in vuedx-typecheck, so I will add any further comment here instead.

@stephen-yau
Copy link
Author

Things are moving fast.. I tried on vite 2.0.0-beta.2 which just release less than an hour ago and it still failed. However, it seems that if I remove "dist" directory before I run vuedx-typecheck, everything work fine. I think the issue is located in diagnostics.ts, add the dist directory in ignore on line 113 should fix the issue:

  const files = await glob(
    ['**/*.vue', '**/*.ts', '**/*.js', '**/*.jsx', '**/*.tsx'],
    {
      cwd: directory,
      absolute: true,
      ignore: ['node_modules', 'node_modules/**/*', '**/node_modules'],
    },
  )

But I cannot seems to build vue-developer-experience successfully on my fork (got some rollup fail message when try to build it), so I cannot verify it for now.

znck added a commit that referenced this issue Jan 5, 2021
@znck znck closed this as completed in #143 Jan 12, 2021
znck added a commit that referenced this issue Jan 12, 2021
…iagnostics (#143)

* fix(typecheck): use projectInfo to get root file to trigger project diagnostics

fix #140
fix #133

* fix: normalize file names from glob

* chore: use project error for both

* fix: handle windows paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant