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

Vue typechecking is incorrect when setting skipTypeCheck: false for @nx/vite:build executor #20242

Closed
4 tasks
domantas-simplex opened this issue Nov 14, 2023 · 2 comments · Fixed by #26450
Closed
4 tasks
Assignees
Labels
outdated scope: bundlers Issues related to webpack, rollup type: bug

Comments

@domantas-simplex
Copy link

domantas-simplex commented Nov 14, 2023

Current Behavior

Running nx run <vue-project-name>:build on brand new vue project with "skipTypeCheck": false produces typescript errors. It doesn't catch typescript errors in *.vue files either.

Expected Behavior

nx run <vue-project-name>:build with "skipTypeCheck": false should produce no errors on brand new vue project and should typecheck not only *.ts files, but *.vue files as well.

GitHub Repo

https://github.com/domantas-simplex/nx-vue-typecheck-monorepo

Steps to Reproduce

git clone [email protected]:domantas-simplex/nx-vue-typecheck-monorepo.git && cd nx-vue-typecheck-monorepo && npm i && npx nx run typechecking-test:build

or

  1. git clone [email protected]:domantas-simplex/nx-vue-typecheck-monorepo.git
  2. cd nx-vue-typecheck-monorepo
  3. npm i
  4. npx nx run typechecking-test:build

Nx Report

Node   : 20.9.0
   OS     : darwin-arm64
   npm    : 10.1.0
   
   nx                 : 17.1.2
   @nx/js             : 17.1.2
   @nx/linter         : 17.1.2
   @nx/eslint         : 17.1.2
   @nx/workspace      : 17.1.2
   @nx/devkit         : 17.1.2
   @nx/eslint-plugin  : 17.1.2
   @nx/playwright     : 17.1.2
   @nrwl/tao          : 17.1.2
   @nx/vite           : 17.1.2
   @nx/vue            : 17.1.2
   @nx/web            : 17.1.2
   typescript         : 5.2.2

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Looks like typechecking is performed with usual typescript instead of vue-tsc.

const result = await runTypeCheck({

export async function runTypeCheck(
options: TypeCheckOptions
): Promise<TypeCheckResult> {
const { ts, workspaceRoot, cacheDir, config, compilerOptions } =
await setupTypeScript(options);

async function setupTypeScript(options: TypeCheckOptions) {
const ts = await import('typescript');

Vue projects should be typechecked with vue-tsc - https://www.npmjs.com/package/vue-tsc

Example of typechecking script: https://github.com/vuejs/create-vue-templates/blob/371a1995e07a71328c3163917479a9e30d9ba1a4/typescript/package.json#L10

@AgentEnder AgentEnder added the scope: bundlers Issues related to webpack, rollup label Nov 16, 2023
Copy link

This issue has been automatically marked as stale because it hasn't had any activity for 6 months.
Many things may have changed within this time. The issue may have already been fixed or it may not be relevant anymore.
If at this point, this is still an issue, please respond with updated information.
It will be closed in 21 days if no further activity occurs.
Thanks for being a part of the Nx community! 🙏

@github-actions github-actions bot added the stale label May 15, 2024
@github-actions github-actions bot removed the stale label May 16, 2024
FrozenPandaz pushed a commit that referenced this issue Jul 22, 2024
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

## Current Behavior
<!-- This is the behavior we have today -->
Typechecking of  Vue Projects with Vite is not functioning correctly

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Typechecking of Vue projects should type check the .vue files and not
error in TS files importing .vue files

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #20242

(cherry picked from commit 8cf69c4)
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: bundlers Issues related to webpack, rollup type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants