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

Build fail #1

Closed
SamuelAlev opened this issue Jan 3, 2021 · 1 comment
Closed

Build fail #1

SamuelAlev opened this issue Jan 3, 2021 · 1 comment

Comments

@SamuelAlev
Copy link

SamuelAlev commented Jan 3, 2021

I updated the lib to be able to use Vite 2 and now, dev works fine but builds fail with an issue.
I use the manual import way e.g import CarbonArrowLeft from '/@vite-icons/carbon/arrow-left.vue' and then use it like this <carbon-arrow-left />

Here is the error when building

[vite]: Rollup failed to resolve import "vue" from "../../../../@vite-icons/carbon/arrow-left".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`rollupInputOptions.external`
error during build:
Error: [vite]: Rollup failed to resolve import "vue" from "../../../../@vite-icons/carbon/arrow-left".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`rollupInputOptions.external`
    at onRollupWarning (/Users/xyz/project/node_modules/vite/dist/node/chunks/dep-eb5d6c40.js:47866:15)
    at Object.onwarn (/Users/xyz/project/node_modules/vite/dist/node/chunks/dep-eb5d6c40.js:47753:17)
    at Object.onwarn (/Users/xyz/project/node_modules/rollup/dist/shared/rollup.js:19525:20)
    at ModuleLoader.handleResolveId (/Users/xyz/project/node_modules/rollup/dist/shared/rollup.js:18435:26)
    at /Users/xyz/project/node_modules/rollup/dist/shared/rollup.js:18402:22
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Promise.all (index 0)
    at async ModuleLoader.fetchStaticDependencies (/Users/xyz/project/node_modules/rollup/dist/shared/rollup.js:18400:34)
    at async Promise.all (index 0)
    at async ModuleLoader.fetchModule (/Users/xyz/project/node_modules/rollup/dist/shared/rollup.js:18377:9)

My Vite config:

//vite.config.ts
import Vue from '@vitejs/plugin-vue'
import ViteIcons from 'vite-plugin-icons'
import ViteComponents from 'vite-plugin-components'
import { UserConfig } from 'vite'

const config: UserConfig = {
  plugins: [
    Vue(),

    // https://github.com/antfu/vite-plugin-components
    ViteComponents({
      dirs: ['./src/components', './src/layouts'],
    }),

    // https://github.com/antfu/vite-plugin-icons
    ViteIcons(),
  ],
}

export default config
@antfu
Copy link
Member

antfu commented Jan 4, 2021

Can you share with me a reproduce repo? Thanks.

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

No branches or pull requests

2 participants