histoire-dev / histoire-dev/histoire
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received an instance of URL
- Dominant language
- TypeScript
- Stars
- 3.6k
- Forks
- 212
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
When I try to declare props story and variant on my wrapper, I have this error for all my stories :
```
Failed to resolve import "tailwindcss/resolveConfig.js" from "node_modules/histoire/dist/node/builtin-plugins/tailwind-tokens.js". Does the file exist?
Error while collecting story /Users/benjamin.besse/Development/vue/manager-v2/stories/components/AqDialog.story.vue:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received an instance of URL
at Object.openSync (node:fs:595:10)
at readFileSync (node:fs:471:35)
at file:///Users/benjamin.besse/Development/vue/manager-v2/node_modules/vite/dist/node/constants.js:5:32
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
```
### Reproduction
Have a basic Wrapper like this :
```vue
```
And declare it in `histoire.setup.ts` :
```ts
// ...
import GlobalWrapper from './GlobalWrapper.vue';
export const setupVue3 = defineSetupVue3(({ app, addWrapper }) => {
// ...
addWrapper(GlobalWrapper);
});
```
With that, it works fine.
Now, add just this in the `` :
```ts
<script lang="ts" setup>
import { Story, Variant } from 'histoire';
const props = defineProps<{
story: Story
variant?: Variant
}>();
```
And the error appears for each stories
### System Info
```shell
System:
OS: macOS 13.5.2
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 1.31 GB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
pnpm: 7.30.0 - /usr/local/bin/pnpm
Browsers:
Chrome: 117.0.5938.88
Edge: 114.0.1823.55
Safari: 16.6
npmPackages:
@histoire/controls: 0.17.0 => 0.17.0
@histoire/plugin-vue: 0.17.1 => 0.17.1
@vitejs/plugin-vue: 4.3.4 => 4.3.4
histoire: 0.17.0 => 0.17.0
vite: 4.4.9 => 4.4.9
```
### 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
Assessment
This issue has not been assessed yet.