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

The "path" argument must be of type string. #44

Open
JalenWasHere opened this issue Dec 18, 2024 · 1 comment
Open

The "path" argument must be of type string. #44

JalenWasHere opened this issue Dec 18, 2024 · 1 comment

Comments

@JalenWasHere
Copy link

When running the Storybook watch server I keep running into the following error:

[vagrant@localhost project]$ yarn storybook-watch
yarn run v1.22.22
$ sb dev -p 6006 --no-open --disable-telemetry
@storybook/core v8.4.2

WARN The following packages are incompatible with Storybook 8.4.2 as they depend on different major versions of Storybook packages:
WARN - @storybook/[email protected]
WARN  Repo: https://github.com/storybookjs/storybook/tree/next/code/lib/cli
WARN 
WARN 
WARN Please consider updating your packages or contacting the maintainers for compatibility details.
WARN For more on Storybook 8 compatibility, see the linked GitHub issue:
WARN https://github.com/storybookjs/storybook/issues/26031
(node:254156) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
info => Starting manager..
WARN No story files found for the specified pattern: stories/**/*.mdx
info => Starting preview..
[HPM] Proxy created: /  -> https://localhost
[HPM] Proxy created: /  -> https://localhost
[HPM] Proxy created: /  -> https://localhost
[HPM] Proxy created: /  -> https://localhost
=> Failed to build the preview
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at Object.join (node:path:1250:7)
    at base (./node_modules/@sensiolabs/storybook-symfony-webpack5/src/server/framework-preset.ts:101:11)
    at Array.map (<anonymous>)
    at base (./node_modules/@sensiolabs/storybook-symfony-webpack5/src/server/framework-preset.ts:101:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async base (./node_modules/@sensiolabs/storybook-symfony-webpack5/src/server/framework-preset.ts:101:11)
    at async starter (./node_modules/@sensiolabs/storybook-symfony-webpack5/node_modules/@storybook/builder-webpack5/dist/index.js:1:22057)
    at async Object.start (./node_modules/@sensiolabs/storybook-symfony-webpack5/node_modules/@storybook/builder-webpack5/dist/index.js:1:25862)
    at async storybookDevServer (./node_modules/storybook/node_modules/@storybook/core/dist/core-server/index.cjs:36000:11)
    at async buildOrThrow (./node_modules/storybook/node_modules/@storybook/core/dist/core-server/index.cjs:35017:12)

WARN Broken build, fix the error above.
WARN You may need to refresh the browser.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[vagrant@localhost project]$ 

These are the files I have:

// .storybook/main.js

const config = {
  stories: ["../stories/**/*.stories.js", "../stories/**/*.mdx"],
  addons: [
    "@storybook/addon-webpack5-compiler-swc",
    "@storybook/addon-links",
    "@storybook/addon-essentials",
  ],
  framework: {
    name: "@sensiolabs/storybook-symfony-webpack5",
    options: {
      symfony: {
        server: 'https://localhost',
        proxyPaths: [
          '/assets',
          '/_components',
          '/components',
        ],
        additionalWatchPaths: [
          'assets',
        ]
      }
    },
  },
  docs: {
    autodocs: "tag",
  },
};

export default config;
// stories/Button.stories.js
import Button from '../templates/components/Button.html.twig';

export default {
  component: Button,
};

export const Default = {};
{#templates/components/Button.html.twig#}
<button
    type="{{ type|default('button') }}"
    class="flex items-center py-2 px-4 overflow-hidden text-white font-light text rounded-md transition-all ease-in-out duration-200 cursor-pointer hover:bg-company-darken focus:ring-4 focus:ring-blue-300 !bg-primary"
>
    <span class="font-poppins font-bold">
        {{ label }}
    </span>
    {% if icoon is defined %}
        <i class="bi bi-{{ icoon }} ml-1.5"></i>
    {% endif %}
</button>
<?php
// src/Twig/Components/Button.php
namespace App\Twig\Components;

use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;

#[AsTwigComponent(name: 'Button', template: 'components/Button.html.twig')]
class Button
{
    public string $type = 'success';
    public string $label = 'success';
    public string $message;
}

Is there something I'm missing? Any help would be greatly appreciated

@jmwamser
Copy link

Have you tried to run yarn set version stable and then install yarn and run build?

It is not the same as what I ran into on #34 but it could be something related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants