histoire-dev / histoire-dev/histoire
Error while collecting story - on Windows
- Dominant language
- TypeScript
- Stars
- 3.6k
- Forks
- 212
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
I'm running "npm run story:dev (histoire dev)" and getting the following error:
```
Error while collecting story C:/projects/dirotnet/stories/DnButton.story.vue:
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file and data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
at new NodeError (node:internal/errors:399:5)
at throwIfUnsupportedURLScheme (node:internal/modules/esm/resolve:1059:11)
at defaultResolve (node:internal/modules/esm/resolve:1135:3)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap. (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36)
```
My DnButton.story.vue file:
```vue
import DnButton from "../components/DnButton.vue";
function initState() {
return {
fontSize: "base",
};
}
```
Note that the same code is running successfully on Mac...
### Reproduction
We can't repreduce this code, becase it's related to the specific OS.
### System Info
```shell
System:
OS: Windows 10 10.0.19045
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory: 678.52 MB / 7.92 GB
Binaries:
Node: 18.14.2 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.5.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 110.0.5481.177
Edge: Spartan (44.19041.1266.0), Chromium (110.0.1587.56)
Internet Explorer: 11.0.19041.1566
npmPackages:
@histoire/plugin-nuxt: ^0.15.8 => 0.15.8
@histoire/plugin-vue: ^0.15.8 => 0.15.8
histoire: ^0.15.8 => 0.15.8
```
### Used Package Manager
npm
### Validations
- [X] Follow our [Code of Conduct](https://github.com/histoire-dev/histoire/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/histoire-dev/histoire/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://histoire.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/histoire-dev/histoire/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/histoire-dev/histoire/discussions).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
Contributor guide
Research direction
Start by running npm run story:dev with the reported DnButton.story.vue example on Windows 10 and compare it with the successful Mac behavior. Trace how the C:/projects/dirotnet/stories/DnButton.story.vue path is passed to the ESM loader; done means the story is collected without ERR_UNSUPPORTED_ESM_URL_SCHEME on Windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, nuxtjs, typescript, vite
- Domain
- frontend, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100