Skip to content

fix: add allowImportingTsExtensions and noEmit to tsconfig#896

Open
daichi1998928 wants to merge 1 commit intovuejs:mainfrom
daichi1998928:fix/pnpm-build-error
Open

fix: add allowImportingTsExtensions and noEmit to tsconfig#896
daichi1998928 wants to merge 1 commit intovuejs:mainfrom
daichi1998928:fix/pnpm-build-error

Conversation

@daichi1998928
Copy link

@daichi1998928 daichi1998928 commented May 31, 2025

Fix build error during pnpm build

This PR addresses the build error that occurs when running pnpm build.

Changes Made

  • Added "allowImportingTsExtensions": true, "noEmit": true to tsconfig.json
  • Added ".ts" file extensions to import statements
  • To resolve ES Modules errors

Build Error During pnpm build

@vue/devtools-ui:build: error during build:
@vue/devtools-ui:build: Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '████████████████████/src/devtools/packages/ui/theme' is not supported resolving ES modules imported from ████████████████████/src/devtools/packages/ui/uno.config.ts
@vue/devtools-ui:build:     at finalizeResolution (node:internal/modules/esm/resolver:263:11)
@vue/devtools-ui:build:     at moduleResolve (node:internal/modules/esm/resolver:860:10)
@vue/devtools-ui:build:     at defaultResolve (node:internal/modules/esm/resolver:984:11)
@vue/devtools-ui:build:     at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:780:12)
@vue/devtools-ui:build:     at #cachedDefaultResolve (node:internal/modules/esm/loader:704:25)
@vue/devtools-ui:build:     at ModuleLoader.resolve (node:internal/modules/esm/loader:687:38)
@vue/devtools-ui:build:     at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:305:38)
@vue/devtools-ui:build:     at ModuleJob._link (node:internal/modules/esm/module_job:137:49)
@vue/devtools-ui:build: ELIFECYCLE Command failed with exit code 1.
@vue/devtools-ui:build: ERROR command finished with error: command (████████████████████/src/devtools/packages/ui) ████████████████████/src/devtools/node_modules/.bin/pnpm run build exited (1)
@vue/devtools-core:build: ELIFECYCLE Command failed with exit code 129.
@vue/devtools-api:build: ELIFECYCLE Command failed with exit code 129.
@vue/devtools-ui#build: command (████████████████████/src/devtools/packages/ui) ████████████████████/src/devtools/node_modules/.bin/pnpm run build exited (1)

Tasks:    2 successful, 5 total
Cached:   0 cached, 5 total
  Time:   4.838s
Failed:   @vue/devtools-ui#build

ERROR run failed: command  exited (1)
ELIFECYCLE Command failed with exit code 1.

Root Cause of the Error

  • ES Modules require file extensions in import statements, but some locations were missing these extensions.
  • Using .js extensions causes other errors, so .ts extensions were used instead.

@netlify
Copy link

netlify bot commented May 31, 2025

Deploy Preview for vue-devtools-docs canceled.

Name Link
🔨 Latest commit 721f39a
🔍 Latest deploy log https://app.netlify.com/projects/vue-devtools-docs/deploys/683b1067e0affb0008cc0f56

@daichi1998928 daichi1998928 changed the title config: add allowImportingTsExtensions and noEmit to tsconfig fix: add allowImportingTsExtensions and noEmit to tsconfig May 31, 2025
@daichi1998928 daichi1998928 marked this pull request as ready for review May 31, 2025 14:39
@skirtles-code
Copy link
Contributor

A few observations:

  • I believe this problem was introduced by the release of Node 24. This error doesn't occur with Node 22.22.1.
  • The error is fixed on main. Testing with the latest Node LTS, 24.14.0, I can hit this error up until commit 58d8737. After that it builds successfully. That commit updates several dependencies. I'm not sure which one fixed the problem, but presumably one of the old dependencies wasn't fully compatible with Node 24.
  • The error still occurs on the v7-patch branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants