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

Missing components and assets #2454

Closed
3 tasks done
denyncrawford opened this issue Mar 10, 2021 · 1 comment
Closed
3 tasks done

Missing components and assets #2454

denyncrawford opened this issue Mar 10, 2021 · 1 comment

Comments

@denyncrawford
Copy link

denyncrawford commented Mar 10, 2021

Describe the bug

I was being able to do a functional build with vite@1 and now that I have updated my configuration and my modules to work with vite@2, some assets and components do not load correctly and have paths that do not correspond to the real absolute paths.

It works perfect on dev and although I am making an app with electron, it should not be a problem since as I mentioned before the builds were good with vite@1.

It is not a problem with the assets, they exist in the build folder. Seems to be a problem when they are required.

This is a more detailed issue where you can find all the error messages and screenshots:

MangoTsing/vite-electron-quick#11

Although I don't think it has to do with electron, again. Still I put it on vite-electron-quick to rule out the possibility.

This is my vite config:

import { join } from 'path'
import { UserConfig } from 'vite'
import dotenv from 'dotenv'
import vue from '@vitejs/plugin-vue'

dotenv.config({ path: join(__dirname, '.env') })
const root = join(__dirname, 'src/render')

const config: UserConfig = {
  root,
  resolve: {
    alias: {
      '/@/': root,
    }
  },
  base: './',
  build: {
    outDir: join('../../dist/render'),
    emptyOutDir: true,
    assetsInlineLimit: 0
  },
  server: {
    port: +process.env.PORT,
  },
  plugins: [
    vue()
  ],
  optimizeDeps: {
    exclude: [
      'electron-is-dev',
      'electron-store',
    ]
  },
}

export default config

Reproduction

https://github.com/denyncrawford/mismor-guillotine

A reproduction is required unless you are absolutely sure that the the problem is obvious and the information you provided is enough for us to understand what the problem is. If a report has only vague description (e.g. just a generic error message) and has no reproduction, it will receive "need reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed.

System Info

  • vite latest:
  • Operating System: Windows 10 2004
  • Node version: 15.2.0
  • Package manager (npm) and version: 7.0.8
@patak-dev
Copy link
Member

Check out https://vitejs.dev/guide/migration.html#alias-behavior-change, I think this may be the issue here. I'm closing this one as it is pointing to an old version of Vite. If your issue still persists, please create a new bug report against the latest Vite version. Try to isolate the issue in a minimal reproduction, thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Aug 5, 2021
This issue was closed.
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

2 participants