Comments (9)
same as above, you don't need the default()
like
module.exports = function unplugin() {
return [
require('unplugin-auto-import/webpack').default({
imports: ['vue', 'vue-router', 'pinia'],
eslintrc: {
enabled: true
},
dts: 'src/typings/auto-imports.d.ts'
}),
require('unplugin-vue-components/webpack').default({
dts: 'src/typings/components.d.ts',
resolvers: [require('unplugin-icons/resolver')()]
}),
require('unplugin-icons/webpack')({ // The error appears in this line
compiler: 'vue2',
scale: 1,
defaultClass: 'inline-block',
autoInstall: true
})
];
};
from unplugin-icons.
Start a new pull request in StackBlitz Codeflow.
from unplugin-icons.
I also encountered this problem. Is there any good solution at this stage?
from unplugin-icons.
@wjw020206 you can downgrade to v0.17.0
from unplugin-icons.
@wjw020206 you can downgrade to v0.17.0
alright, thank you very much
from unplugin-icons.
@wjw020206 you can downgrade to v0.17.0
hi. I tried to use v0.17.0 but there were new problems, Prompt error: Typerror: Require (...). Default is not a function
module.exports = function unplugin() {
return [
require('unplugin-auto-import/webpack').default({
imports: ['vue', 'vue-router', 'pinia'],
eslintrc: {
enabled: true
},
dts: 'src/typings/auto-imports.d.ts'
}),
require('unplugin-vue-components/webpack').default({
dts: 'src/typings/components.d.ts',
resolvers: [require('unplugin-icons/resolver').default()] // The error appears in this line
}),
require('unplugin-icons/webpack').default({
compiler: 'vue2',
scale: 1,
defaultClass: 'inline-block',
autoInstall: true
})
];
};
from unplugin-icons.
you can remove the default()
and try again
from unplugin-icons.
you can remove the
default()
and try again
I tried it, the problem changed,Prompt error: Typerror: Require (...). Default is not a function
module.exports = function unplugin() {
return [
require('unplugin-auto-import/webpack').default({
imports: ['vue', 'vue-router', 'pinia'],
eslintrc: {
enabled: true
},
dts: 'src/typings/auto-imports.d.ts'
}),
require('unplugin-vue-components/webpack').default({
dts: 'src/typings/components.d.ts',
resolvers: [require('unplugin-icons/resolver')]
}),
require('unplugin-icons/webpack').default({ // The error appears in this line
compiler: 'vue2',
scale: 1,
defaultClass: 'inline-block',
autoInstall: true
})
];
};
This is the dependence I used in my current project
{
"dependencies": {
"core-js": "^3.36.1",
"pinia": "^2.1.7",
"vue": "2.7.16",
"vue-router": "3.6.5"
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@babel/eslint-parser": "^7.24.1",
"@iconify-json/ep": "^1.1.15",
"@vue/cli-plugin-babel": "5.0.8",
"@vue/cli-plugin-eslint": "5.0.8",
"@vue/cli-plugin-router": "5.0.8",
"@vue/cli-service": "5.0.8",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.24.1",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"sass": "^1.74.1",
"sass-loader": "^14.1.1",
"unplugin-auto-import": "^0.17.5",
"unplugin-icons": "^0.17.0",
"unplugin-vue-components": "^0.26.0",
"vue-cli-plugin-pinia": "~0.2.4",
"vue-template-compiler": "^2.7.16"
}
}
from unplugin-icons.
same as above, you don't need the
default()
like
module.exports = function unplugin() { return [ require('unplugin-auto-import/webpack').default({ imports: ['vue', 'vue-router', 'pinia'], eslintrc: { enabled: true }, dts: 'src/typings/auto-imports.d.ts' }), require('unplugin-vue-components/webpack').default({ dts: 'src/typings/components.d.ts', resolvers: [require('unplugin-icons/resolver')()] }), require('unplugin-icons/webpack')({ // The error appears in this line compiler: 'vue2', scale: 1, defaultClass: 'inline-block', autoInstall: true }) ]; };
Thank you very much, the problem is solved.
from unplugin-icons.
Related Issues (20)
- auto-import confused with mdi and mdi-light collection HOT 7
- Vue3/Vite auto importing icon names with sequential dashed numbers results in mangled filename HOT 15
- Latest version breaks with unplugin-vue-components HOT 12
- ID collisions in astro HOT 1
- `resolveId` doesn't work as expected when query params contains `.`s HOT 1
- components.d.ts path error if the name startswith prefix defined in collections HOT 6
- Vue 2 examples won't run
- Events don't fire in Vue 2 HOT 5
- How to use the icon's raw svg as url(data:....) in css? HOT 5
- How to auto import unplugin-icons ? HOT 1
- How to auto import icon set with plural names? HOT 7
- Symptom When the icon is imported automatically, an error message is displayed indicating that the icon version does not match
- Unable to use ?raw in SvelteKit HOT 3
- Hydration mismatch warning in vue >=3.4 (nuxt >=3.9) if an SVG uses `url(#id)` HOT 3
- Svelte 5 runes mode not working HOT 4
- Qwik type definitions are not exported in package.json HOT 1
- I import icons dynamically in Svelte? HOT 1
- About icon aspect ratio
- Vue error when using vue-tsc - Type '{}' is not assignable to type 'ComponentProps<string>' HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unplugin-icons.