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

Next 9.5.4: Loading fonts from internal source breaks #17751

Closed
mduleone opened this issue Oct 9, 2020 · 3 comments
Closed

Next 9.5.4: Loading fonts from internal source breaks #17751

mduleone opened this issue Oct 9, 2020 · 3 comments

Comments

@mduleone
Copy link
Contributor

mduleone commented Oct 9, 2020

Bug report

Describe the bug

When running next version 9.5.3, our fonts loaded without issue. When we upgraded to 9.5.4, our fonts are unable to render. I've created a demo project that loads an open source font (Montserrat) in the same way that we load our paid-font (through <link rel="preload" ... /> in _document.js and defining the @font-face in a _fonts.scss file that gets pulled in to globals.scss)

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Clone the demo repo
  2. run npm install
  3. run npm run dev
  4. See error in console, get 500 internal error when attempting to load the page.
    error - ./styles/globals.scss (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-7-1!./node_modules/next/dist/compiled/postcss-loader??__nextjs_postcss!./node_modules/resolve-url-loader??ref--5-oneOf-7-3!./node_modules/sass-loader/dist/cjs.js??ref--5-oneOf-7-4!./styles/globals.scss)
    Error: Can't resolve '/Montserrat-Bold.ttf' in '/path/to/repo/next-font-error/styles'

Error: Can't resolve '/Montserrat-Regular.ttf' in '/Users/mattduleone/sites/next-font-error/styles'

  1. To see that this is a regression:
    1. Install the previous version of next npm install [email protected], and repeat step 3
    2. See no error in the console, see the page load properly when attempting to visit the page.

Expected behavior

The dev/build/start commands should work and pages should render properly.

System information

  • OS: macOS (local), Linux (in CI)
  • Version of Next.js: 9.5.4
  • Version of Node.js: 12.3.1

Additional context

If there's a better or more canonical way for us to load our proprietary fonts, we're game to move in that direction. This was the solution we found works best prior to [email protected]

@mduleone mduleone changed the title Next 9.5.4: Loading fonts from internal source breaks when upgrading from Next 9.5.3 Next 9.5.4: Loading fonts from internal source breaks Oct 9, 2020
@mduleone
Copy link
Contributor Author

mduleone commented Oct 9, 2020

Apologies, I just checked out the closed issues, and this seems to have already been reported several times and closed.
Do we know when we can expect a resolution to land in a non-canary build?

@jamesmosier
Copy link
Contributor

Typically there are no exact timelines for releases, but I would say to keep up on this issue and its progress watch this issue which has the primary report: #17701

@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 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants