-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The next/font mock does not work on windows.
Steps to reproduce the behavior
I created a reproduction repository with minimal setup (bootstraping nextjs, storybook and then adding fonts): https://github.com/izakgl/nextjs-storybook-vite
Steps:
- Clone repo
- Install dependencies
- Run
npm run storybookon a Windows machine - Open a button story
Expected behavior
Story shows up and fonts work as expected.
Screenshots and/or logs
The response for virtual inter is an empty object.

Environment
- OS: Windows
- Browser (if applicable): All browsers
Additional context
I pinpointed the issue to be here:
| const pathSep = path.sep; |
Because it's taking separator from
node:path package, which is \\ on Windows, it then fails to detect the correct file as vite is loading this from next/font/google/target.css with forward slash separators. If I hardcode / there, then this also works on Windows.MarZab
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working