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

Importing global CSS out of App should explain the alternative in error message #14464

Closed
Timer opened this issue Jun 22, 2020 · 4 comments · Fixed by #14639
Closed

Importing global CSS out of App should explain the alternative in error message #14464

Timer opened this issue Jun 22, 2020 · 4 comments · Fixed by #14639
Assignees
Labels
good first issue Easy to fix issues, good for newcomers
Milestone

Comments

@Timer
Copy link
Member

Timer commented Jun 22, 2020

Currently, we only explain to use CSS Modules in the err.sh link. The error message does not provide guidance on what to do next, only the problem.

See the messages in this file:
https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack/config/blocks/css/messages.ts

We should update the error messages displayed to the user very clear that there's an alternative so they're not stuck thinking Next.js cannot import CSS.

@Timer Timer added good first issue Easy to fix issues, good for newcomers type: documentation labels Jun 22, 2020
@Timer Timer modified the milestones: 9.4.5, 9.x.x, backlog Jun 22, 2020
@Timer
Copy link
Member Author

Timer commented Jun 23, 2020

I updated the original comment: no reproduction is necessary per say, see the messages.ts file and read the associated err.sh links already there, then improve the message!

@ysun62
Copy link
Contributor

ysun62 commented Jun 23, 2020

Got it. Thanks!

@ysun62
Copy link
Contributor

ysun62 commented Jun 23, 2020

Hi Joe, just to clarify.

The current error message for getGlobalImportError says Global CSS cannot be imported from files other than your Custom <App>. Please move all global CSS imports to pages/_app.js.

What you would like is to inform the users that they can also use CSS Modules instead of Global CSS, correct? So I would add something like Hey, or you can also use CSS Modules instead!?

@Timer Timer self-assigned this Jun 30, 2020
@kodiakhq kodiakhq bot closed this as completed in #14639 Jun 30, 2020
kodiakhq bot pushed a commit that referenced this issue Jun 30, 2020
@Timer Timer modified the milestones: backlog, iteration 4 Jun 30, 2020
rokinsky pushed a commit to rokinsky/next.js that referenced this issue Jul 11, 2020
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants