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

resolve.aliasfailing in *.vue files #506

Open
8 of 9 tasks
ClayCore opened this issue Jan 14, 2025 · 1 comment
Open
8 of 9 tasks

resolve.aliasfailing in *.vue files #506

ClayCore opened this issue Jan 14, 2025 · 1 comment

Comments

@ClayCore
Copy link

ClayCore commented Jan 14, 2025

Related plugins

Describe the bug

My project structure is the following

my-app/
├── client/ (vite + typescript + vue app)
└── shared/ (data models)

in client/ I have the following (amongst other omitted settings) in my tsconfig.json

{
  "compilerOptions": {
    "paths": {
      "@/*": ["./src/*"],
      "@models/*": ["../shared/src/models/*"]
    }
  }
}

This allows me to refer to models in the shared directory using the @models/ alias.
As far as I understand, I must add these aliases to the vite.config.ts as well, and so I did.

// vite.config.ts
import { defineConfig, UserConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "node:path";

/** @type {import('vite').UserConfig} */
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      "@models": path.resolve(__dirname, "../shared/src/models"),
      "@": path.join(__dirname, "./src"),
    },
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `
          @use "@/styles/core/reset";
        `,
      },
    },
  },
} satisfies UserConfig);

This does not work in any *.vue files. It does expectedly work in *.ts files (as well as in the vite config itself as evident by the aliases used in the additional scss data), such as the entry point for the vue application, but not in App.vue or any other vue source file that utilizes <script setup lang="ts"></script>

I tried using path.join and fileURLToPath instead of path.resolve, as well as messing around with the order in which these aliases are defined, but did not fix the problem.

I've also attempted to use npm workspaces to manage the local dependency on the shared directory, but that hasn't exactly worked out either (or I'm missing something obvious).

I've supplied the reproduction repository, but I'm kinda uncertain if it's the absolutely the most minimal reproduction of the issue. For some odd reason, it does kind of work inconsistently when building the project, but not when simply running vite on its own.

I went through the discussions page and other issues and found some on the internet as well, but none of the fixes and solutions I found worked.

Reproduction

https://github.com/ClayCore/vite-vue-reproduction

Steps to reproduce

  1. Run yarn install in the root directory of the project.
  2. Run yarn run dev in the /packages/client directory.
  3. Open url provided by vite in the browser.

System Info

System:
    OS: Windows 10 10.0.17763
    CPU: (16) x64 AMD Ryzen 7 3800X 8-Core Processor
    Memory: 6.26 GB / 15.95 GB
  Binaries:
    Node: 22.11.0 - E:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.9.0 - E:\Program Files\nodejs\npm.CMD
  Browsers:
    Internet Explorer: 11.0.17763.2989


Not sure if that tool works properly (or if thats the completely output), but I'm using `Firefox 135.0b4 (64-bit)` for testing.

Used Package Manager

yarn

Logs

Click to expand!
> yarn run dev
yarn run v1.22.22
$ vite --debug
  vite:config bundled config file loaded in 109.05ms +0ms
  vite:config using resolved config: {
  vite:config   plugins: [
  vite:config     'vite:optimized-deps',
  vite:config     'vite:watch-package-data',
  vite:config     'vite:pre-alias',
  vite:config     'alias',
  vite:config     'vite:modulepreload-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html-inline-proxy',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm-helper',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:vue',
  vite:config     'vite:wasm-fallback',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:worker-import-meta-url',
  vite:config     'vite:asset-import-meta-url',
  vite:config     'vite:dynamic-import-vars',
  vite:config     'vite:import-glob',
  vite:config     'vite:client-inject',
  vite:config     'vite:css-analysis',
  vite:config     'vite:import-analysis'
  vite:config   ],
  vite:config   resolve: {
  vite:config     externalConditions: [ 'node' ],
  vite:config     extensions: [ '.mjs', '.js', '.ts', '.jsx', '.tsx', '.json' ],
  vite:config     dedupe: [ 'vue' ],
  vite:config     noExternal: [],
  vite:config     external: [],
  vite:config     preserveSymlinks: false,
  vite:config     alias: [
  vite:config       {
  vite:config         find: '@models',
  vite:config         replacement: 'S:\\wplace\\work\\redacted\\vite-import-test\\packages\\shared\\src\\models'
  vite:config       },
  vite:config       {
  vite:config         find: '@',
  vite:config         replacement: 'S:\\wplace\\work\\redacted\\vite-import-test\\packages\\client\\src'
  vite:config       },
  vite:config       {
  vite:config         find: /^\/?@vite\/env/,
  vite:config         replacement: '/@fs/S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/client/env.mjs'
  vite:config       },
  vite:config       {
  vite:config         find: /^\/?@vite\/client/,
  vite:config         replacement: '/@fs/S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/client/client.mjs'
  vite:config       }
  vite:config     ],
  vite:config     mainFields: [ 'module', 'jsnext:main', 'jsnext' ],
  vite:config     conditions: [ 'module', 'node', 'development|production' ],
  vite:config     enableBuiltinNoExternalCheck: false
  vite:config   },
  vite:config   css: {
  vite:config     transformer: 'postcss',
  vite:config     preprocessorMaxWorkers: 0,
  vite:config     devSourcemap: false,
  vite:config     preprocessorOptions: {
  vite:config       scss: {
  vite:config         additionalData: '\n          @use "@/styles/core/reset";\n        '
  vite:config       }
  vite:config     },
  vite:config     lightningcss: undefined
  vite:config   },
  vite:config   optimizeDeps: {
  vite:config     include: [],
  vite:config     exclude: [],
  vite:config     needsInterop: [],
  vite:config     extensions: [],
  vite:config     disabled: undefined,
  vite:config     holdUntilCrawlEnd: true,
  vite:config     force: false,
  vite:config     noDiscovery: false,
  vite:config     esbuildOptions: { preserveSymlinks: false }
  vite:config   },
  vite:config   server: {
  vite:config     port: 5173,
  vite:config     strictPort: false,
  vite:config     host: undefined,
  vite:config     https: undefined,
  vite:config     open: false,
  vite:config     proxy: undefined,
  vite:config     cors: true,
  vite:config     headers: {},
  vite:config     warmup: { clientFiles: [], ssrFiles: [] },
  vite:config     middlewareMode: false,
  vite:config     fs: {
  vite:config       strict: true,
  vite:config       deny: [ '.env', '.env.*', '*.{crt,pem}', '**/.git/**' ],
  vite:config       allow: [ 'S:/wplace/work/redacted/vite-import-test' ]
  vite:config     },
  vite:config     preTransformRequests: true,
  vite:config     perEnvironmentStartEndDuringDev: false,
  vite:config     sourcemapIgnoreList: [Function: isInNodeModules$1]
  vite:config   },
  vite:config   define: {
  vite:config     __VUE_OPTIONS_API__: true,
  vite:config     __VUE_PROD_DEVTOOLS__: false,
  vite:config     __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false
  vite:config   },
  vite:config   ssr: {
  vite:config     target: 'node',
  vite:config     optimizeDeps: {
  vite:config       esbuildOptions: { preserveSymlinks: false },
  vite:config       include: [],
  vite:config       exclude: [],
  vite:config       needsInterop: [],
  vite:config       extensions: [],
  vite:config       holdUntilCrawlEnd: true,
  vite:config       force: false,
  vite:config       noDiscovery: true
  vite:config     },
  vite:config     external: [],
  vite:config     noExternal: [],
  vite:config     resolve: {
  vite:config       conditions: [ 'module', 'node', 'development|production' ],
  vite:config       externalConditions: [ 'node' ]
  vite:config     }
  vite:config   },
  vite:config   environments: {
  vite:config     client: {
  vite:config       define: {
  vite:config         __VUE_OPTIONS_API__: true,
  vite:config         __VUE_PROD_DEVTOOLS__: false,
  vite:config         __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false
  vite:config       },
  vite:config       resolve: {
  vite:config         externalConditions: [ 'node' ],
  vite:config         extensions: [ '.mjs', '.js', '.ts', '.jsx', '.tsx', '.json' ],
  vite:config         dedupe: [ 'vue' ],
  vite:config         noExternal: [],
  vite:config         external: [],
  vite:config         preserveSymlinks: false,
  vite:config         alias: [
  vite:config           {
  vite:config             find: '@models',
  vite:config             replacement: 'S:\\wplace\\work\\redacted\\vite-import-test\\packages\\shared\\src\\models'
  vite:config           },
  vite:config           {
  vite:config             find: '@',
  vite:config             replacement: 'S:\\wplace\\work\\redacted\\vite-import-test\\packages\\client\\src'
  vite:config           },
  vite:config           {
  vite:config             find: /^\/?@vite\/env/,
  vite:config             replacement: '/@fs/S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/client/env.mjs'
  vite:config           },
  vite:config           {
  vite:config             find: /^\/?@vite\/client/,
  vite:config             replacement: '/@fs/S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/client/client.mjs'
  vite:config           }
  vite:config         ],
  vite:config         mainFields: [ 'browser', 'module', 'jsnext:main', 'jsnext' ],
  vite:config         conditions: [ 'module', 'browser', 'development|production' ],
  vite:config         enableBuiltinNoExternalCheck: false
  vite:config       },
  vite:config       keepProcessEnv: false,
  vite:config       consumer: 'client',
  vite:config       optimizeDeps: {
  vite:config         include: [],
  vite:config         exclude: [],
  vite:config         needsInterop: [],
  vite:config         extensions: [],
  vite:config         disabled: undefined,
  vite:config         holdUntilCrawlEnd: true,
  vite:config         force: false,
  vite:config         noDiscovery: false,
  vite:config         esbuildOptions: { preserveSymlinks: false }
  vite:config       },
  vite:config       dev: {
  vite:config         warmup: [],
  vite:config         sourcemap: { js: true },
  vite:config         sourcemapIgnoreList: [Function: isInNodeModules$1],
  vite:config         preTransformRequests: true,
  vite:config         createEnvironment: [Function: defaultCreateClientDevEnvironment],
  vite:config         recoverable: true,
  vite:config         moduleRunnerTransform: false
  vite:config       },
  vite:config       build: {
  vite:config         target: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
  vite:config         polyfillModulePreload: true,
  vite:config         modulePreload: { polyfill: true },
  vite:config         outDir: 'dist',
  vite:config         assetsDir: 'assets',
  vite:config         assetsInlineLimit: 4096,
  vite:config         sourcemap: false,
  vite:config         terserOptions: {},
  vite:config         rollupOptions: {},
  vite:config         commonjsOptions: { include: [ /node_modules/ ], extensions: [ '.js', '.cjs' ] },
  vite:config         dynamicImportVarsOptions: { warnOnError: true, exclude: [ /node_modules/ ] },
  vite:config         write: true,
  vite:config         emptyOutDir: null,
  vite:config         copyPublicDir: true,
  vite:config         manifest: false,
  vite:config         lib: false,
  vite:config         ssrManifest: false,
  vite:config         ssrEmitAssets: false,
  vite:config         reportCompressedSize: true,
  vite:config         chunkSizeWarningLimit: 500,
  vite:config         watch: null,
  vite:config         cssCodeSplit: true,
  vite:config         minify: 'esbuild',
  vite:config         ssr: false,
  vite:config         emitAssets: true,
  vite:config         createEnvironment: [Function: createEnvironment],
  vite:config         cssTarget: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
  vite:config         cssMinify: true
  vite:config       }
  vite:config     },
  vite:config     ssr: {
  vite:config       define: {
  vite:config         __VUE_OPTIONS_API__: true,
  vite:config         __VUE_PROD_DEVTOOLS__: false,
  vite:config         __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false
  vite:config       },
  vite:config       resolve: {
  vite:config         externalConditions: [ 'node' ],
  vite:config         extensions: [ '.mjs', '.js', '.ts', '.jsx', '.tsx', '.json' ],
  vite:config         dedupe: [ 'vue' ],
  vite:config         noExternal: [],
  vite:config         external: [],
  vite:config         preserveSymlinks: false,
  vite:config         alias: [
  vite:config           {
  vite:config             find: '@models',
  vite:config             replacement: 'S:\\wplace\\work\\redacted\\vite-import-test\\packages\\shared\\src\\models'
  vite:config           },
  vite:config           {
  vite:config             find: '@',
  vite:config             replacement: 'S:\\wplace\\work\\redacted\\vite-import-test\\packages\\client\\src'
  vite:config           },
  vite:config           {
  vite:config             find: /^\/?@vite\/env/,
  vite:config             replacement: '/@fs/S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/client/env.mjs'
  vite:config           },
  vite:config           {
  vite:config             find: /^\/?@vite\/client/,
  vite:config             replacement: '/@fs/S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/client/client.mjs'
  vite:config           }
  vite:config         ],
  vite:config         mainFields: [ 'module', 'jsnext:main', 'jsnext' ],
  vite:config         conditions: [ 'module', 'node', 'development|production' ],
  vite:config         enableBuiltinNoExternalCheck: false
  vite:config       },
  vite:config       keepProcessEnv: true,
  vite:config       consumer: 'server',
  vite:config       optimizeDeps: {
  vite:config         include: [],
  vite:config         exclude: [],
  vite:config         needsInterop: [],
  vite:config         extensions: [],
  vite:config         disabled: undefined,
  vite:config         holdUntilCrawlEnd: true,
  vite:config         force: false,
  vite:config         noDiscovery: true,
  vite:config         esbuildOptions: { preserveSymlinks: false }
  vite:config       },
  vite:config       dev: {
  vite:config         warmup: [],
  vite:config         sourcemap: { js: true },
  vite:config         sourcemapIgnoreList: [Function: isInNodeModules$1],
  vite:config         preTransformRequests: false,
  vite:config         createEnvironment: [Function: defaultCreateDevEnvironment],
  vite:config         recoverable: false,
  vite:config         moduleRunnerTransform: true
  vite:config       },
  vite:config       build: {
  vite:config         target: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
  vite:config         polyfillModulePreload: true,
  vite:config         modulePreload: { polyfill: true },
  vite:config         outDir: 'dist',
  vite:config         assetsDir: 'assets',
  vite:config         assetsInlineLimit: 4096,
  vite:config         sourcemap: false,
  vite:config         terserOptions: {},
  vite:config         rollupOptions: {},
  vite:config         commonjsOptions: { include: [ /node_modules/ ], extensions: [ '.js', '.cjs' ] },
  vite:config         dynamicImportVarsOptions: { warnOnError: true, exclude: [ /node_modules/ ] },
  vite:config         write: true,
  vite:config         emptyOutDir: null,
  vite:config         copyPublicDir: true,
  vite:config         manifest: false,
  vite:config         lib: false,
  vite:config         ssrManifest: false,
  vite:config         ssrEmitAssets: false,
  vite:config         reportCompressedSize: true,
  vite:config         chunkSizeWarningLimit: 500,
  vite:config         watch: null,
  vite:config         cssCodeSplit: true,
  vite:config         minify: false,
  vite:config         ssr: true,
  vite:config         emitAssets: false,
  vite:config         createEnvironment: [Function: createEnvironment],
  vite:config         cssTarget: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
  vite:config         cssMinify: 'esbuild'
  vite:config       }
  vite:config     }
  vite:config   },
  vite:config   configFile: 'S:/wplace/work/redacted/vite-import-test/packages/client/vite.config.ts',
  vite:config   configFileDependencies: [
  vite:config     'S:/wplace/work/redacted/vite-import-test/packages/client/vite.config.ts'
  vite:config   ],
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     optimizeDeps: { force: undefined },
  vite:config     server: { host: undefined }
  vite:config   },
  vite:config   root: 'S:/wplace/work/redacted/vite-import-test/packages/client',
  vite:config   base: '/',
  vite:config   decodedBase: '/',
  vite:config   rawBase: '/',
  vite:config   publicDir: 'S:/wplace/work/redacted/vite-import-test/packages/client/public',
  vite:config   cacheDir: 'S:/wplace/work/redacted/vite-import-test/packages/client/node_modules/.vite',
  vite:config   command: 'serve',
  vite:config   mode: 'development',
  vite:config   isWorker: false,
  vite:config   mainConfig: null,
  vite:config   bundleChain: [],
  vite:config   isProduction: false,
  vite:config   json: { namedExports: true, stringify: 'auto' },
  vite:config   esbuild: { jsxDev: true },
  vite:config   builder: undefined,
  vite:config   preview: {
  vite:config     port: 4173,
  vite:config     strictPort: false,
  vite:config     host: undefined,
  vite:config     https: undefined,
  vite:config     open: false,
  vite:config     proxy: undefined,
  vite:config     cors: true,
  vite:config     headers: {}
  vite:config   },
  vite:config   envDir: 'S:/wplace/work/redacted/vite-import-test/packages/client',
  vite:config   env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     warnOnce: [Function: warnOnce],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen],
  vite:config     hasErrorLogged: [Function: hasErrorLogged]
  vite:config   },
  vite:config   packageCache: Map(1) {
  vite:config     'fnpd_S:/wplace/work/redacted/vite-import-test/packages/client' => {
  vite:config       dir: 'S:/wplace/work/redacted/vite-import-test/packages/client',
  vite:config       data: {
  vite:config         name: '@reproduction/client',
  vite:config         private: true,
  vite:config         version: '0.0.0',
  vite:config         type: 'module',
  vite:config         scripts: {
  vite:config           dev: 'vite --debug',
  vite:config           build: 'vue-tsc -b && vite build',
  vite:config           preview: 'vite preview'
  vite:config         },
  vite:config         dependencies: {
  vite:config           '@vitejs/plugin-vue': '5.2.1',
  vite:config           '@vue/language-plugin-pug': '2.1.10',
  vite:config           pug: '3.0.3',
  vite:config           sass: '1.80.6',
  vite:config           typescript: '5.7.3',
  vite:config           vite: '6.0.7',
  vite:config           'vue-router': '4.4.5',
  vite:config           'vue-tsc': '2.2.0',
  vite:config           vue: '3.5.13'
  vite:config         }
  vite:config       },
  vite:config       hasSideEffects: [Function: hasSideEffects],
  vite:config       setResolvedCache: [Function: setResolvedCache],
  vite:config       getResolvedCache: [Function: getResolvedCache]
  vite:config     },
  vite:config     set: [Function (anonymous)]
  vite:config   },
  vite:config   worker: { format: 'iife', plugins: '() => plugins', rollupOptions: {} },
  vite:config   appType: 'spa',
  vite:config   experimental: { importGlobRestoreExtension: false, hmrPartialAccept: false },
  vite:config   future: undefined,
  vite:config   dev: {
  vite:config     warmup: [],
  vite:config     sourcemap: { js: true },
  vite:config     sourcemapIgnoreList: [Function: isInNodeModules$1],
  vite:config     preTransformRequests: false,
  vite:config     createEnvironment: [Function: defaultCreateDevEnvironment],
  vite:config     recoverable: false,
  vite:config     moduleRunnerTransform: false
  vite:config   },
  vite:config   build: {
  vite:config     target: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
  vite:config     polyfillModulePreload: true,
  vite:config     modulePreload: { polyfill: true },
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     sourcemap: false,
  vite:config     terserOptions: {},
  vite:config     rollupOptions: {},
  vite:config     commonjsOptions: { include: [ /node_modules/ ], extensions: [ '.js', '.cjs' ] },
  vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [ /node_modules/ ] },
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     copyPublicDir: true,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssrManifest: false,
  vite:config     ssrEmitAssets: false,
  vite:config     reportCompressedSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null,
  vite:config     cssCodeSplit: true,
  vite:config     minify: 'esbuild',
  vite:config     ssr: false,
  vite:config     emitAssets: false,
  vite:config     createEnvironment: [Function: createEnvironment],
  vite:config     cssTarget: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
  vite:config     cssMinify: true
  vite:config   },
  vite:config   getSortedPlugins: [Function: getSortedPlugins],
  vite:config   getSortedPluginHooks: [Function: getSortedPluginHooks],
  vite:config   createResolver: [Function: createResolver],
  vite:config   fsDenyGlob: [Function: arrayMatcher],
  vite:config   safeModulePaths: Set(0) {}
  vite:config } +15ms
  vite:deps Hash is consistent. Skipping. Use --force to override. +0ms

  VITE v6.0.7  ready in 520 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
  vite:html-fallback Rewriting GET / to /index.html +0ms
  vite:time 21.54ms /index.html +0ms
  vite:resolve 4.87ms /src/main.ts -> S:/wplace/work/redacted/vite-import-test/packages/client/src/main.ts +0ms
  vite:load 2.45ms [fs] /src/main.ts +0ms
  vite:resolve 1.48ms ./App.vue -> S:/wplace/work/redacted/vite-import-test/packages/client/src/App.vue +18ms
  vite:resolve 2.57ms ./router.ts -> S:/wplace/work/redacted/vite-import-test/packages/client/src/router.ts +1ms
  vite:resolve 4.03ms vue -> S:/wplace/work/redacted/vite-import-test/packages/client/node_modules/.vite/deps/vue.js?v=b5f5688a +1ms
  vite:optimize-deps load S:/wplace/work/redacted/vite-import-test/packages/client/node_modules/.vite/deps/vue.js +0ms
  vite:import-analysis 9.09ms [3 imports rewritten] src/main.ts +0ms
  vite:transform 19.82ms /src/main.ts +0ms
  vite:resolve 0.24ms /@vite/client -> S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/client/client.mjs +8ms
  vite:cache [304] /src/main.ts +0ms
  vite:time 0.50ms /src/main.ts +33ms
  vite:load 8.06ms [plugin] /node_modules/.vite/deps/vue.js?v=b5f5688a +27ms
  vite:resolve 0.17ms ./chunk-3SZSTCRY.js -> S:/wplace/work/redacted/vite-import-test/packages/client/node_modules/.vite/deps/chunk-3SZSTCRY.js?v=b5f5688a +5ms
  vite:optimize-deps load S:/wplace/work/redacted/vite-import-test/packages/client/node_modules/.vite/deps/chunk-3SZSTCRY.js +12ms
  vite:import-analysis 3.01ms [1 imports rewritten] node_modules/.vite/deps/vue.js?v=b5f5688a +11ms
  vite:transform 4.40ms /node_modules/.vite/deps/vue.js?v=b5f5688a +11ms
  vite:load 14.34ms [fs] /src/App.vue +6ms
  vite:load 37.53ms [fs] /src/router.ts +24ms
  vite:load 33.44ms [fs] /@vite/client +2ms
  vite:resolve 0.11ms @vite/env -> S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/client/env.mjs +43ms
  vite:import-analysis 3.53ms [1 imports rewritten] S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/client/client.mjs +43ms
  vite:transform 15.30ms /@vite/client +43ms
  vite:time 51.94ms /@vite/client +49ms
  vite:resolve 0.30ms ./views/Home.vue -> S:/wplace/work/redacted/vite-import-test/packages/client/src/views/Home.vue +5ms
  vite:resolve 1.26ms vue-router -> S:/wplace/work/redacted/vite-import-test/packages/client/node_modules/.vite/deps/vue-router.js?v=b5f5688a +1ms
  vite:optimize-deps load S:/wplace/work/redacted/vite-import-test/packages/client/node_modules/.vite/deps/vue-router.js +48ms
  vite:import-analysis 3.75ms [2 imports rewritten] src/router.ts +6ms
  vite:transform 23.83ms /src/router.ts +6ms
  vite:time 23.42ms /src/router.ts +7ms
  vite:load 54.48ms [plugin] /node_modules/.vite/deps/chunk-3SZSTCRY.js?v=b5f5688a +26ms
  vite:import-analysis 2.87ms [no imports] node_modules/.vite/deps/chunk-3SZSTCRY.js?v=b5f5688a +10ms
  vite:transform 4.56ms [skipped] /node_modules/.vite/deps/chunk-3SZSTCRY.js?v=b5f5688a +10ms
  vite:load 17.95ms [fs] ../../node_modules/vite/dist/client/env.mjs +7ms
  vite:import-analysis 0.03ms [no imports] S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/client/env.mjs +3ms
  vite:transform 0.93ms ../../node_modules/vite/dist/client/env.mjs +3ms
  vite:time 9.42ms ../../node_modules/vite/dist/client/env.mjs +12ms
  vite:load 16.18ms [fs] /src/views/Home.vue +4ms
  vite:load 19.27ms [plugin] /node_modules/.vite/deps/vue-router.js?v=b5f5688a +3ms
  vite:cache [memory] /node_modules/.vite/deps/chunk-3SZSTCRY.js?v=b5f5688a +0ms
  vite:import-analysis 1.79ms [1 imports rewritten] node_modules/.vite/deps/vue-router.js?v=b5f5688a +9ms
  vite:transform 2.85ms /node_modules/.vite/deps/vue-router.js?v=b5f5688a +8ms
  vite:resolve 1.95ms ./styles/app.scss -> S:/wplace/work/redacted/vite-import-test/packages/client/src/styles/app.scss +35ms
  vite:resolve 2.64ms ./components/Navigation.vue -> S:/wplace/work/redacted/vite-import-test/packages/client/src/components/Navigation.vue +1ms
  vite:cache [memory] /node_modules/.vite/deps/vue.js?v=b5f5688a +14ms
  vite:resolve 4.85ms S:\wplace\work\redacted\vite-import-test\packages\shared\src\models/position -> null +2ms
  vite:hmr [self-accepts] src/views/Home.vue +0ms
  vite:resolve 6.21ms @models/position -> S:\wplace\work\redacted\vite-import-test\packages\shared\src\models/position +1ms
  vite:import-analysis 7.46ms [4 imports rewritten] src/views/Home.vue +16ms
  vite:resolve 7.79ms @models/position -> S:/wplace/work/redacted/vite-import-test/packages/shared/src/models/position +2ms
  vite:transform 23.67ms /src/views/Home.vue +18ms
  vite:time 29.16ms /src/views/Home.vue +27ms
  vite:load 5.40ms [plugin] /src/views/Home.vue?vue&type=template&lang.js +23ms
  vite:load 6.05ms [plugin] /src/App.vue?vue&type=template&lang.js +0ms
16:04:16 [vite] Internal server error: Failed to resolve import "@models/position" from "src/App.vue". Does the file exist?
  Plugin: vite:import-analysis
  File: S:/wplace/work/redacted/vite-import-test/packages/client/src/App.vue:8:25
  3  |  import Navigation from "./components/Navigation.vue";
  4  |  import { onMounted } from "vue";
  5  |  import { Position } from "@models/position";
     |                            ^
  6  |  const _sfc_main = /* @__PURE__ */ _defineComponent({
  7  |    __name: "App",
      at TransformPluginContext._formatError (file:///S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:47397:41)
      at TransformPluginContext.error (file:///S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:47392:16)
      at normalizeUrl (file:///S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:45642:23)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async file:///S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:45761:39
      at async Promise.all (index 4)
      at async TransformPluginContext.transform (file:///S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:45688:7)
      at async EnvironmentPluginContainer.transform (file:///S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:47223:18)
      at async loadAndTransform (file:///S:/wplace/work/redacted/vite-import-test/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:41034:27)
  vite:time 99.60ms /src/App.vue +37ms
16:04:16 [vite] (client) Pre-transform error: Failed to resolve import "@models/position" from "src/App.vue". Does the file exist?
  Plugin: vite:import-analysis
  File: S:/wplace/work/redacted/vite-import-test/packages/client/src/App.vue:8:25
  3  |  import Navigation from "./components/Navigation.vue";
  4  |  import { onMounted } from "vue";
  5  |  import { Position } from "@models/position";
     |                            ^
  6  |  const _sfc_main = /* @__PURE__ */ _defineComponent({
  7  |    __name: "App",
  vite:load 42.49ms [plugin]  plugin-vue:export-helper +38ms
  vite:import-analysis 0.01ms [no imports]  plugin-vue:export-helper +197ms
  vite:transform 154.47ms [skipped]  plugin-vue:export-helper +195ms
  vite:cache [memory] /node_modules/.vite/deps/vue.js?v=b5f5688a +201ms
  vite:hmr [self-accepts] src/views/Home.vue?vue&type=template&lang.js +200ms
  vite:hmr [self-accepts] src/App.vue?vue&type=template&lang.js +0ms
  vite:import-analysis 3.54ms [1 imports rewritten] src/views/Home.vue?vue&type=template&lang.js +3ms
  vite:import-analysis 4.19ms [1 imports rewritten] src/App.vue?vue&type=template&lang.js +1ms
  vite:transform 197.12ms /src/views/Home.vue?vue&type=template&lang.js +5ms
  vite:transform 196.79ms /src/App.vue?vue&type=template&lang.js +0ms
  vite:cache [304] /src/views/Home.vue?vue&type=template&lang.js +295ms
  vite:time 0.60ms /src/views/Home.vue?vue&type=template&lang.js +164ms
  vite:cache [memory]  plugin-vue:export-helper +8ms
  vite:time 0.75ms /@id/__x00__plugin-vue:export-helper +2ms
  vite:load 209.64ms [plugin] /vite.svg +166ms
  vite:import-analysis 0.04ms [no imports] /vite.svg +8ms
  vite:transform 0.86ms [skipped] /vite.svg +8ms
  vite:time 7.14ms /vite.svg?import +4ms
  vite:load 212.69ms [fs] /src/components/Navigation.vue +3ms
  vite:cache [memory]  plugin-vue:export-helper +8ms
  vite:hmr [self-accepts] src/components/Navigation.vue +16ms
  vite:import-analysis 2.20ms [3 imports rewritten] src/components/Navigation.vue +6ms
  vite:transform 4.57ms /src/components/Navigation.vue +7ms
  vite:load 3.25ms [plugin] /src/components/Navigation.vue?vue&type=template&scoped=578fcad0&lang.js +6ms
  vite:load 3.92ms [plugin] /src/components/Navigation.vue?vue&type=style&index=0&scoped=578fcad0&lang.scss +1ms
  vite:cache [memory] /node_modules/.vite/deps/vue.js?v=b5f5688a +236ms
  vite:hmr [self-accepts] src/components/Navigation.vue?vue&type=template&scoped=578fcad0&lang.js +236ms
  vite:import-analysis 1.74ms [1 imports rewritten] src/components/Navigation.vue?vue&type=template&scoped=578fcad0&lang.js +237ms
  vite:transform 234.84ms /src/components/Navigation.vue?vue&type=template&scoped=578fcad0&lang.js +236ms
  vite:resolve 0.40ms S:\wplace\work\redacted\vite-import-test\packages\client\src/styles/core/reset -> S:/wplace/work/redacted/vite-import-test/packages/client/src/styles/core/_reset.scss +459ms
  vite:resolve 1.54ms @/styles/core/reset -> S:/wplace/work/redacted/vite-import-test/packages/client/src/styles/core/_reset.scss +1ms
  vite:load 464.28ms [fs] /src/styles/app.scss +245ms
  vite:hmr [self-accepts] src/styles/app.scss +60ms
  vite:import-analysis 0.83ms [0 imports rewritten] src/styles/app.scss +60ms
  vite:transform 49.35ms /src/styles/app.scss +60ms
  vite:hmr [self-accepts] src/components/Navigation.vue?vue&type=style&index=0&scoped=578fcad0&lang.scss +2ms
  vite:import-analysis 1.81ms [0 imports rewritten] src/components/Navigation.vue?vue&type=style&index=0&scoped=578fcad0&lang.scss +2ms
  vite:transform 296.31ms /src/components/Navigation.vue?vue&type=style&index=0&scoped=578fcad0&lang.scss +2ms

Validations

@miclgael
Copy link

Seeing the same with pnpm as package manager.

Any idea if its possible to roll back?

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

No branches or pull requests

2 participants