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

Failed to resolve import "@ag-grid-community/styles/ag-grid.css" #7897

Closed
Infinity-chakra opened this issue Apr 28, 2024 · 2 comments
Closed

Comments

@Infinity-chakra
Copy link

I've got the following error while using the version 31.2.1 of the ag-grid-vue3 in Vue 3.
image

I followed the instruction from the npm guideline.

npm install --save @ag-grid-community/core @ag-grid-community/vue3

import { AgGridVue } from "@ag-grid-community/vue3";
import "@ag-grid-community/styles/ag-grid.css";
import "@ag-grid-community/styles/ag-theme-quartz.css"; 

I'm using the unplugin-vue-components plugin in my project, wonder if this could be causing the issue.

@YSHgroup
Copy link

It seems you use the module type of ag-grid-vue3. If so, further installation would be required, like @ag-grid-community/client-side-row-model, @ag-grid-community/styles.
The installation of @ag-grid-community/styles will be resolve the error Failed to resolve import "@ag-grid-community/styles/ag-grid.css" you faced.
And you may encounter another error, so, make sure to add the following lines.

import { ModuleRegistry } from '@ag-grid-community/core';
import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
ModuleRegistry.registerModules([ ClientSideRowModelModule ]);

Hope this would be help for you.

@Infinity-chakra
Copy link
Author

Hi @YSHgroup,
Thank you for your help. It works well as you described.

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

3 participants