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

Getting Global CSS cannot be imported from within node_modules error #28

Open
april-ctrlspire opened this issue Mar 2, 2023 · 4 comments

Comments

@april-ctrlspire
Copy link

april-ctrlspire commented Mar 2, 2023

Hi. I'm using a fresh NextJS 13.2.1 with Tailwind and integrated the Sanity Studio V3 in /pages directory. They're working fine. I installed this plugin but it's getting Global CSS cannot be imported from within node_modules error.

error

sanity.config.ts:

import { deskTool } from 'sanity/desk';
import { visionTool } from '@sanity/vision';
import { codeInput } from '@sanity/code-input';
import { latexInput } from 'sanity-plugin-latex-input';

import { schemaTypes } from '@/schemas/index';

export const projectId = process.env.NEXT_PUBLIC_SANITY_PROJECT_ID!;
export const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET!;

export default defineConfig({
  basePath: '/studio',
  projectId,
  dataset,

  plugins: [deskTool(), visionTool(), codeInput(), latexInput()],

  schema: {
    types: schemaTypes,
  },
});
@april-ctrlspire
Copy link
Author

Hello, any updates?

@MohanadOO
Copy link

I'm using NextJS as well and I'm facing the same issue here.

is there any workaround to make it work?

This is the suggested solution provided by NextJS:

image

@filipesmedeiros
Copy link

filipesmedeiros commented Mar 28, 2023

Hey! You can use my fork: https://github.com/filipesmedeiros/latex-input

The only thing it does is fix this issue. It removes the CSS import from the component itself. Then you have to import it yourself at the app level (e.g. _app.tsx or layout.tsx)

EDIT: I accidentally deleted it lol sorry for the broken link

@himetsai
Copy link

Hey @filipesmedeiros, could you elaborate on how you removed the CSS import from the component itself? In particular, what do you mean by component?

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

4 participants