Skip to content

[Bug]: ssr-tests-v9 build fails on Windows #24798

@spmonahan

Description

@spmonahan

Library

React Components / v9 (@fluentui/react-components)

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
    Memory: 15.12 GB / 31.59 GB
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (105.0.1343.33), ChromiumDev (107.0.1379.1)
    Internet Explorer: 11.0.22000.120

Are you reporting Accessibility issue?

no

Reproduction

On Windows (not WSL) run yarn workspace @fluentui/ssr-tests-v9 build

Bug Description

Actual Behavior

Running yarn workspace @fluentui/ssr-tests-v9 build fails on Windows (I'm using Powershell but anything that's not WSL will fail).

Example error:

✘ [ERROR] Could not resolve "......packages\react-components\react-dialogsrcstoriesDialogDialogCustomTrigger.stories"

    dist/stories.tsx:138:53:
      138 │ ...CustomTrigger as DialogCustomTrigger } from "......packages\react-components\react-dialogsrcstoriesDialogDialogCustomTrigger.stories";~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path
  "......packages\react-components\react-dialogsrcstoriesDialogDialogCustomTrigger.stories" as
  external to exclude it from the bundle, which will remove this error.

Examining the dist/stories.tsx file that is built shows imports like this:

import { Default as AccordionDefault } from "......packages\react-components\react-accordionsrcstoriesAccordionAccordionDefault.stories";

This looks to be from this line in getImportsFromIndexFile.ts that uses a file system path for the import path:

path: path.relative(distDir, path.resolve(path.dirname(filename), sourcePath.node.value)),

Using Node's path.posix might be the way to go here but in my (admittedly simple) test posix includes the Windows drive letter in the path (e.g., "C:/the/path").

Expected Behavior

ssr-tests-v9 can be built and run on Windows.

Logs

No response

Requested priority

Normal

Products/sites affected

No response

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions