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

[Regression] Module not found to url() function (sass) when compiling #30998

Closed
rtritto opened this issue Nov 4, 2021 · 4 comments · Fixed by #31134
Closed

[Regression] Module not found to url() function (sass) when compiling #30998

rtritto opened this issue Nov 4, 2021 · 4 comments · Fixed by #31134
Labels
bug Issue was opened via the bug report template.

Comments

@rtritto
Copy link

rtritto commented Nov 4, 2021

What version of Next.js are you using?

12.0.3

What version of Node.js are you using?

14.17.0

What browser are you using?

Chrome

What operating system are you using?

Windows

How are you deploying your application?

Vercel

Describe the Bug

From next v12.0.3-canary.2, special functions of sass , like url, aren't compiled correctly.

Actual Behavior

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./pages/style.scss:4:0
Module not found: Can't resolve './data:application/font-woff;charset=utf-8;base64'

Import trace for requested module:
./pages/style.scss
./pages/_app.js

https://nextjs.org/docs/messages/module-not-found
wait  - compiling...
error - ./pages/style.scss:4:0
Module not found: Can't resolve './data:application/font-woff;charset=utf-8;base64'

Import trace for requested module:
./pages/style.scss
./pages/_app.js

https://nextjs.org/docs/messages/module-not-found

Expected Behavior

Compiling done.

To Reproduce

  1. yarn init -y
  2. yarn set version berry
  3. yarn add next@canary react react-dom sass
  4. Create pages/_app.js file:
import './style.scss'
  1. Create pages/style.scss file:
@font-face {
  src: url(data:application/font-woff;charset=utf-8;base64) format('woff');
}
  1. yarn next

OR (my use case)

  1. Clone material-ui + next example
  2. yarn set version berry
  3. yarn add @mui/material@5.0.4 next@canary sass videojs-font
  4. Create pages/style.scss file:
@import 'videojs-font/scss/icons';
  1. Add in pages/_app.js file on first line:
import './style.scss'
  1. yarn next
@rtritto rtritto added the bug Issue was opened via the bug report template. label Nov 4, 2021
@rtritto
Copy link
Author

rtritto commented Nov 4, 2021

Similar #30895

@rtritto rtritto changed the title [Regression] Module not found in url() function (sass) when compiling [Regression] Module not found to url() function (sass) when compiling Nov 4, 2021
@rtritto
Copy link
Author

rtritto commented Nov 5, 2021

Related to update of mini-css-plugin at v2 in #30617.

FYI @sokra @ijjk @timneutkens

@rtritto
Copy link
Author

rtritto commented Nov 6, 2021

Should help: asset modules guide

@kodiakhq kodiakhq bot closed this as completed in #31134 Nov 8, 2021
kodiakhq bot pushed a commit that referenced this issue Nov 8, 2021
…ss (#31134)

upgrade to loader-utils 3.1.2 for hash fix

fixes #31016
fixes #30998
@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 27, 2022
natew pushed a commit to natew/next.js that referenced this issue Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants